فهرست منبع

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

Johan Ahlen 10 سال پیش
والد
کامیت
ecb2c62
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) {