Эх сурвалжийг харах

HUE-6255 [notebook] Prevent multiple autocomplete dropdown to show in the notebook

Johan Ahlen 8 жил өмнө
parent
commit
8d80a9b

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/ace/ext-language_tools.js


+ 3 - 0
desktop/libs/notebook/src/notebook/templates/hue_ace_autocompleter.mako

@@ -428,6 +428,9 @@ from desktop.views import _ko
         });
 
         var autocompleterShowSub = huePubSub.subscribe('hue.ace.autocompleter.show', function (data) {
+          if (data.editor !== self.editor()) {
+            return;
+          }
           var session = self.editor().getSession();
           var pos = self.editor().getCursorPosition();
           var line = session.getLine(pos.row);

+ 1 - 1
tools/ace-editor/lib/ace/autocomplete.js

@@ -420,7 +420,7 @@ Autocomplete.startCommand = {
             pos.left += rect.left - editor.renderer.scrollLeft;
             pos.left += renderer.gutterWidth;
 
-            huePubSub.publish('hue.ace.autocompleter.show', { position: pos, lineHeight: lineHeight });
+            huePubSub.publish('hue.ace.autocompleter.show', { editor: editor, position: pos, lineHeight: lineHeight });
             return;
         }
         if (!editor.completer)

+ 1 - 1
tools/ace-editor/lib/ace/ext/language_tools.js

@@ -166,7 +166,7 @@ var doLiveAutocomplete = function(e) {
             pos.left += rect.left - editor.renderer.scrollLeft;
             pos.left += renderer.gutterWidth;
 
-            huePubSub.publish('hue.ace.autocompleter.show', { position: pos, lineHeight: lineHeight });
+            huePubSub.publish('hue.ace.autocompleter.show', { editor: editor, position: pos, lineHeight: lineHeight });
         } else if (e.command.name === "backspace" && !prefix) {
             huePubSub.publish('hue.ace.autocompleter.hide');
         }

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно