Browse Source

[notebook] Switch from double click to alt/ctrl + click to follow ace links

Double click is often used to select whole words in text (triple click for line and quadruple click for document), this doesn't work if the table and file links are trigged on double click.
Johan Ahlen 10 năm trước cách đây
mục cha
commit
e85cdee

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

@@ -1826,7 +1826,7 @@ ko.bindingHandlers.aceEditor = {
         this.onClick = this.onClick.bind(this);
         Event.addListener(editor.renderer.scroller, "mousemove", this.onMouseMove);
         Event.addListener(editor.renderer.content, "mouseout", this.onMouseOut);
-        Event.addListener(editor.renderer.content, "dblclick", this.onClick);
+        Event.addListener(editor.renderer.content, "click", this.onClick);
       };
 
       Oop.inherits(HueLink, Tooltip);
@@ -1903,7 +1903,7 @@ ko.bindingHandlers.aceEditor = {
         };
 
         this.onClick = function (e) {
-          if (this.link) {
+          if (this.link && (e.altKey || e.metaKey)) {
             this.link.editor = this.editor;
             this._signal("open", this.link);
             this.clear()

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -446,7 +446,7 @@ from desktop.views import _ko
           errors: errors,
           autocompleter: aceAutocompleter,
           assistHelper: assistHelper,
-          openIt: '${ _ko("Double click to open it") }',
+          openIt: '${ _ko("Alt or Ctrl + Click to open it") }',
           placeholder: $root.snippetPlaceholders[type()] }"></div>
       </div>
     <div class="clearfix"></div>