add shortcut key (ctrl-enter) to go from comment area to focused submit button

This commit is contained in:
Frédéric Péters 2020-04-24 08:40:59 +02:00
parent 9d99c5e9aa
commit cb989fb8e2
1 changed files with 8 additions and 0 deletions

View File

@ -189,6 +189,14 @@ $(function() {
}
return true;
});
$('textarea#issue_notes').on('keydown', function(e) {
// ctrl-enter in comment area -> focus on submit button
if ((e.ctrlKey || e.metaKey) && (e.keyCode == 13 || e.keyCode == 10)) {
$('input[name=commit]').last().focus()
return false;
}
return true;
});
function handle_jobs(jobs) {
$(jobs).each(function(idx, job) {