Przeglądaj źródła

[assist] Make double click events DB specific

Johan Ahlen 10 lat temu
rodzic
commit
e1a5ece

+ 6 - 6
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1641,15 +1641,15 @@ $(document).ready(function () {
     }
   });
 
-  huePubSub.subscribe('assist.dblClickItem', function(assistEntry) {
-    var text = assistEntry.editorText();
+  huePubSub.subscribe('assist.dblClickDbItem', function(assistDbEntry) {
+    var text = assistDbEntry.editorText();
     if (codeMirror.getValue() == queryPlaceholder) {
       codeMirror.setValue("");
-      if (assistEntry.definition.isTable) {
-        text = "SELECT * FROM " + assistEntry.editorText() + " LIMIT 100";
+      if (assistDbEntry.definition.isTable) {
+        text = "SELECT * FROM " + assistDbEntry.editorText() + " LIMIT 100";
       }
-      else if (assistEntry.definition.isColumn) {
-        text = "SELECT " + assistEntry.editorText().split(",")[0] + " FROM " + assistEntry.parent.editorText() + " LIMIT 100";
+      else if (assistDbEntry.definition.isColumn) {
+        text = "SELECT " + assistDbEntry.editorText().split(",")[0] + " FROM " + assistDbEntry.parent.editorText() + " LIMIT 100";
       }
     }
     codeMirror.replaceSelection(text);

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/assist/assistDbEntry.js

@@ -275,7 +275,7 @@
 
   AssistDbEntry.prototype.dblClick = function () {
     var self = this;
-    huePubSub.publish('assist.dblClickItem', self);
+    huePubSub.publish('assist.dblClickDbItem', self);
   };
 
   AssistDbEntry.prototype.toggleOpen = function () {

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

@@ -2172,15 +2172,15 @@
         }
       });
 
-      huePubSub.subscribe("assist.dblClickItem", function(assistEntry) {
+      huePubSub.subscribe("assist.dblClickDbItem", function(assistDbEntry) {
         if ($el.data("last-active-editor")) {
-          var text = assistEntry.editorText();
+          var text = assistDbEntry.editorText();
           if (editor.getValue() == "") {
-            if (assistEntry.definition.isTable) {
-              text = "SELECT * FROM " + assistEntry.editorText() + " LIMIT 100";
+            if (assistDbEntry.definition.isTable) {
+              text = "SELECT * FROM " + assistDbEntry.editorText() + " LIMIT 100";
             }
-            else if (assistEntry.definition.isColumn) {
-              text = "SELECT " + assistEntry.editorText().split(",")[0] + " FROM " + assistEntry.parent.editorText() + " LIMIT 100";
+            else if (assistDbEntry.definition.isColumn) {
+              text = "SELECT " + assistDbEntry.editorText().split(",")[0] + " FROM " + assistDbEntry.parent.editorText() + " LIMIT 100";
             }
           }
           editor.session.insert(editor.getCursorPosition(), text);