Bläddra i källkod

HUE-7682 [assist] Expand the right assist content if there's just one table present

Enrico Berti 8 år sedan
förälder
incheckning
9d64faa
1 ändrade filer med 14 tillägg och 9 borttagningar
  1. 14 9
      desktop/core/src/desktop/templates/assist.mako

+ 14 - 9
desktop/core/src/desktop/templates/assist.mako

@@ -2462,15 +2462,20 @@ from desktop.views import _ko
         // This fetches the columns for each table synchronously with 2 second in between.
         var loadEntries = function () {
           window.clearTimeout(loadEntriesTimeout);
-          loadEntriesTimeout = window.setTimeout(function () {
-            self.activeTables().every(function (table) {
-              if (!table.loaded && !table.hasErrors() && !table.loading()) {
-                table.loadEntries(loadEntries, true);
-                return false;
-              }
-              return !table.loading();
-            })
-          }, 2000);
+          if (self.activeTables().length === 1) {
+            self.activeTables()[0].open(true);
+          }
+          else {
+            loadEntriesTimeout = window.setTimeout(function () {
+              self.activeTables().every(function (table) {
+                if (!table.loaded && !table.hasErrors() && !table.loading()) {
+                  table.loadEntries(loadEntries, true);
+                  return false;
+                }
+                return !table.loading();
+              })
+            }, 2000);
+          }
         };
 
         self.autocompleteFromEntries = function (nonPartial, partial) {