浏览代码

HUE-4360 [editor] Search enabling should be ko based

The Python does not exist as it is in a function and for some reason it was silently ignored.
Romain Rigaux 9 年之前
父节点
当前提交
aec2251

+ 2 - 2
desktop/core/src/desktop/templates/assist.mako

@@ -791,11 +791,11 @@ from desktop.views import _ko
   </script>
 
   <script type="text/html" id="assist-panel-navigator-search">
-    % if is_navigator_enabled:
+    <!-- ko if: navigatorEnabled -->
       <div class="searchbar">
         <input id="appendedInput" placeholder="${ _('Search everywhere...') }" type="text" data-bind="hasFocus: searchHasFocus, textinput: searchInput"><button class="btn btn-primary add-on" data-bind="enabled: !searchSubmitted(), click: function () { if (searchInput() !== '') { searchInput(''); searchHasFocus(false); } else { searchHasFocus(true); window.setTimeout(performSearch, 200); } }"><i class="fa" data-bind="css: { 'fa-search': searchInput() === '' && ! searchHasFocus(), 'fa-times' : searchInput() !== '' || searchHasFocus() }"></i></button>
       </div>
-    % endif
+    <!-- /ko -->
   </script>
 
   <script type="text/html" id="assist-panel-inner-header">

+ 1 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1859,6 +1859,7 @@
     self.successUrl = ko.observable(options.success_url);
     self.isOptimizerEnabled = ko.observable(options.is_optimizer_enabled);
     self.isNavigatorEnabled = ko.observable(options.is_navigator_enabled);
+
     self.canSave = ko.computed(function() {
       // Saved query or history but history coming from a saved query
       return self.selectedNotebook() && self.selectedNotebook().canWrite() && (