Преглед изворни кода

[notebook] Assist dbl click should only add to the last active snippet and not all of them

Johan Ahlen пре 10 година
родитељ
комит
ecb2c62bcc
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 5 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -1725,6 +1725,8 @@ ko.bindingHandlers.aceEditor = {
     });
 
     editor.on("focus", function () {
+      $(".ace-editor").data("last-active-editor", false);
+      $el.data("last-active-editor", true);
       onFocus(editor);
     });
 
@@ -1993,7 +1995,9 @@ ko.bindingHandlers.aceEditor = {
     });
 
     huePubSub.subscribe("assist.dblClickItem", function(value) {
-      editor.session.insert(editor.getCursorPosition(),value);
+      if ($el.data("last-active-editor")) {
+        editor.session.insert(editor.getCursorPosition(), value);
+      }
     });
 
     editor.commands.on("afterExec", function (e) {