Explorar el Código

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

Johan Ahlen hace 10 años
padre
commit
ecb2c62bcc
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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) {