mirror of
https://github.com/valitydev/redash.git
synced 2024-11-08 18:03:54 +00:00
34 lines
592 B
JavaScript
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);
|
|
}
|