redash/client/app/pages/queries/schema-browser.js
2017-03-20 17:37:32 +02:00

34 lines
592 B
JavaScript

import template from './schema-browser.html';
function SchemaBrowserCtrl($scope) {
'ngInject';
this.showTable = (table) => {
table.collapsed = !table.collapsed;
$scope.$broadcast('vsRepeatTrigger');
};
this.getSize = (table) => {
let size = 18;
if (!table.collapsed) {
size += 18 * table.columns.length;
}
return size;
};
}
const SchemaBrowser = {
bindings: {
schema: '<',
onRefresh: '&',
},
controller: SchemaBrowserCtrl,
template,
};
export default function (ngModule) {
ngModule.component('schemaBrowser', SchemaBrowser);
}