first fix for sql query autofocus and submitting the query with ctrl-enter

This commit is contained in:
jous 2013-01-09 01:23:38 +02:00
parent a2908fe658
commit a67c90a0d8

View File

@ -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();
@ -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() {