You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/07/23 18:51:45 UTC

[GitHub] kkhatua commented on a change in pull request #1392: Implements DRILL-6611 to enable meta-enter query submission in web query interface

kkhatua commented on a change in pull request #1392: Implements DRILL-6611 to enable meta-enter query submission in web query interface
URL: https://github.com/apache/drill/pull/1392#discussion_r204511759
 
 

 ##########
 File path: exec/java-exec/src/main/resources/rest/query/query.ftl
 ##########
 @@ -111,6 +111,12 @@
       enableBasicAutocompletion: true,
       enableLiveAutocompletion: false
     });
+    // meta-enter to submit query
+    document.getElementById('queryForm')
+            .addEventListener('keydown', function(e) {
+      if (!(e.keyCode == 13 && e.metaKey)) return;
 
 Review comment:
   For Windows machines, the `metaKey` equivalent is the Windows key. Interestingly, this is not supported by Firefox 48+ (Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey )
   For Windows, the key combination is `Ctrl+Enter` .  (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/ctrlKey)
   So, you'll need to do a check for the key events something like this:
   ```
   if (! ((e.ctrlKey || e.metaKey) &&  e.keyCode == 13) ) return;
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services