From cb989fb8e219316b1f1129c3dad8c0c3e31b3e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 24 Apr 2020 08:40:59 +0200 Subject: [PATCH] add shortcut key (ctrl-enter) to go from comment area to focused submit button --- javascripts/theme.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/javascripts/theme.js b/javascripts/theme.js index f919cbc..50fc8e6 100644 --- a/javascripts/theme.js +++ b/javascripts/theme.js @@ -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) {