Skip to content

Commit

Permalink
a bit more flexible fix for sql query autofocus and submitting it wit…
Browse files Browse the repository at this point in the history
…h ctrl-enter
  • Loading branch information
jous committed Jan 8, 2013
1 parent a67c90a commit bd4aedd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/functions.js
Expand Up @@ -3379,12 +3379,13 @@ AJAX.registerOnload('functions.js', function() {
matchBrackets: true,
indentUnit: 4,
mode: "text/x-mysql",
lineWrapping: true,
onKeyEvent: function (inst, e) {
if (e.type == 'keydown' && e.ctrlKey && (e.keyCode == 13 || e.keyCode == 10)) {
$("#button_submit_query").submit();
return false;
}
lineWrapping: true
});
codemirror_wrapper_element = codemirror_editor.getWrapperElement();
$(codemirror_wrapper_element).bind('keypress', function (e) {
if (e.ctrlKey && (e.keyCode == 13 || e.keyCode == 10)) { // ctrl-enter is 10 in chrome and ie, but 13 in ff
$("#button_submit_query").submit();
return false;
}
});
codemirror_editor.focus();
Expand Down

0 comments on commit bd4aedd

Please sign in to comment.