Skip to content

Commit

Permalink
first fix for sql query autofocus and submitting the query with ctrl-…
Browse files Browse the repository at this point in the history
…enter
  • Loading branch information
jous committed Jan 8, 2013
1 parent a2908fe commit a67c90a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/functions.js
Expand Up @@ -1423,12 +1423,6 @@ AJAX.registerOnload('functions.js', function() {
}
});

$('#sqlquery').focus().keydown(function (e) {
if (e.ctrlKey && e.keyCode == 13) {
$("#sqlqueryform").submit();
}
});

if ($('#input_username')) {
if ($('#input_username').val() == '') {
$('#input_username').focus();
Expand Down Expand Up @@ -3385,8 +3379,15 @@ AJAX.registerOnload('functions.js', function() {
matchBrackets: true,
indentUnit: 4,
mode: "text/x-mysql",
lineWrapping: true
lineWrapping: true,
onKeyEvent: function (inst, e) {
if (e.type == 'keydown' && e.ctrlKey && (e.keyCode == 13 || e.keyCode == 10)) {
$("#button_submit_query").submit();
return false;
}
}
});
codemirror_editor.focus();
}
});
AJAX.registerTeardown('functions.js', function() {
Expand Down

0 comments on commit a67c90a

Please sign in to comment.