Browse Source

HUE-4618 [editor] Query selection highlighting does not stay

Enrico Berti 9 năm trước cách đây
mục cha
commit
cccb67ff2d

+ 6 - 7
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -2745,9 +2745,14 @@
           placeHolderVisible = false;
         }
         if (options.updateOnInput){
-
           snippet.statement_raw(removeUnicodes(editor.getValue()));
         }
+      });
+
+      editor.on("focus", function () {
+        snippet.inFocus(true);
+        $(".ace-editor").data("last-active-editor", false);
+        $el.data("last-active-editor", true);
         if (editor.session.$backMarkers) {
           for (var marker in editor.session.$backMarkers) {
             if (editor.session.$backMarkers[marker].clazz === 'highlighted') {
@@ -2757,12 +2762,6 @@
         }
       });
 
-      editor.on("focus", function () {
-        snippet.inFocus(true);
-        $(".ace-editor").data("last-active-editor", false);
-        $el.data("last-active-editor", true);
-      });
-
       editor.selection.on("changeSelection", function () {
         snippet.selectedStatement(editor.getSelectedText());
       });