diff --git a/client/app/pages/queries/query.html b/client/app/pages/queries/query.html index f3da2305..b93999e4 100644 --- a/client/app/pages/queries/query.html +++ b/client/app/pages/queries/query.html @@ -83,7 +83,10 @@
- +
diff --git a/client/app/pages/queries/schema-browser.html b/client/app/pages/queries/schema-browser.html index ed83a4bd..2a9b6d45 100644 --- a/client/app/pages/queries/schema-browser.html +++ b/client/app/pages/queries/schema-browser.html @@ -1,13 +1,16 @@
- +
-
-
-
- {{table.name}} - ({{table.size}}) +
+
+
+ + + {{table.name}} + ({{table.size}}) +
{{column}}
diff --git a/client/app/pages/queries/schema-browser.js b/client/app/pages/queries/schema-browser.js index e1912790..604c114d 100644 --- a/client/app/pages/queries/schema-browser.js +++ b/client/app/pages/queries/schema-browser.js @@ -1,31 +1,30 @@ import template from './schema-browser.html'; -function schemaBrowser() { - return { - restrict: 'E', - scope: { - schema: '=', - }, - template, - link($scope) { - $scope.showTable = (table) => { - table.collapsed = !table.collapsed; - $scope.$broadcast('vsRepeatTrigger'); - }; +function SchemaBrowserCtrl($scope) { + this.showTable = (table) => { + table.collapsed = !table.collapsed; + $scope.$broadcast('vsRepeatTrigger'); + }; - $scope.getSize = (table) => { - let size = 18; + this.getSize = (table) => { + let size = 18; - if (!table.collapsed) { - size += 18 * table.columns.length; - } + if (!table.collapsed) { + size += 18 * table.columns.length; + } - return size; - }; - }, + return size; }; } +const SchemaBrowser = { + bindings: { + schema: '<', + }, + controller: SchemaBrowserCtrl, + template, +}; + export default function (ngModule) { - ngModule.directive('schemaBrowser', schemaBrowser); + ngModule.component('schemaBrowser', SchemaBrowser); }