a bit more flexible fix for sql query autofocus and submitting it with ctrl-enter
This commit is contained in:
parent
a67c90a0d8
commit
bd4aedd455
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user