浏览代码

HUE-5150 [metadata] Don't do nav search on empty input

Johan Ahlen 9 年之前
父节点
当前提交
5b0d9e8
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      desktop/core/src/desktop/templates/assist.mako

+ 7 - 3
desktop/core/src/desktop/templates/assist.mako

@@ -1481,12 +1481,16 @@ from metadata.conf import has_navigator
         % endif
         % endif
 
 
         self.performSearch = function () {
         self.performSearch = function () {
-          if (!self.searchActive()) {
-            self.searchActive(true);
-          }
           if (self.searchInput() === lastQuery) {
           if (self.searchInput() === lastQuery) {
             return;
             return;
           }
           }
+          if (self.searchInput() === '') {
+            self.searchActive(false);
+            return;
+          }
+          if (!self.searchActive()) {
+            self.searchActive(true);
+          }
           if (self.searching()) {
           if (self.searching()) {
             window.setTimeout(function() {
             window.setTimeout(function() {
               self.performSearch();
               self.performSearch();