Przeglądaj źródła

HUE-6557 [frontend] The context panel should disappear when the editor loses focus on Hue 4

Enrico Berti 8 lat temu
rodzic
commit
76f1280

+ 1 - 0
desktop/core/src/desktop/templates/hue.mako

@@ -742,6 +742,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
           });
           });
           huePubSub.publish('hue.datatable.search.hide');
           huePubSub.publish('hue.datatable.search.hide');
           huePubSub.publish('nicescroll.resize');
           huePubSub.publish('nicescroll.resize');
+          huePubSub.publish('context.panel.visible.editor', false);
           if (app === 'filebrowser') {
           if (app === 'filebrowser') {
             $(window).unbind('hashchange.fblist');
             $(window).unbind('hashchange.fblist');
           }
           }

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

@@ -2587,6 +2587,10 @@ var EditorViewModel = (function() {
       huePubSub.publish('context.panel.visible', newValue);
       huePubSub.publish('context.panel.visible', newValue);
     });
     });
 
 
+    huePubSub.subscribe('context.panel.visible.editor', function (value) {
+      self.isContextPanelVisible(false);
+    });
+
     self.availableSnippets = ko.mapping.fromJS(options.languages);
     self.availableSnippets = ko.mapping.fromJS(options.languages);
 
 
     self.editorMode = ko.observable(options.mode == 'editor');
     self.editorMode = ko.observable(options.mode == 'editor');