popojargo closed pull request #1136: Allow to run query with Ctrl-Enter in 
Mango editor
URL: https://github.com/apache/couchdb-fauxton/pull/1136
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/app/addons/documents/mango/components/MangoQueryEditor.js 
b/app/addons/documents/mango/components/MangoQueryEditor.js
index f04a1589c..15ef83a6e 100644
--- a/app/addons/documents/mango/components/MangoQueryEditor.js
+++ b/app/addons/documents/mango/components/MangoQueryEditor.js
@@ -35,6 +35,20 @@ export default class MangoQueryEditor extends Component {
     this.props.loadQueryHistory({ databaseName: this.props.databaseName });
     // Clear results list in case it was populated by other pages
     this.props.clearResults();
+
+    // Add key binding to run query when doing Ctrl-Enter
+    const editor = this.codeEditor.codeEditor.editor;
+    const runQueryCmdName = "runQuery";
+    if (!editor.commands.byName[runQueryCmdName]) {
+      editor.commands.addCommand({
+        name: runQueryCmdName,
+        bindKey: {win: 'Ctrl-Enter', mac: 'Command-Option-Enter'},
+        exec: () => {
+          this.runQuery({preventDefault: () => {}});
+        },
+        readOnly: true
+      });
+    }
   }
 
   componentDidUpdate (prevProps) {


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to