add shortcut key to open the modify/comment section

This commit is contained in:
Frédéric Péters 2020-04-23 23:00:26 +02:00
parent 0a3718026e
commit 9d99c5e9aa
1 changed files with 13 additions and 0 deletions

View File

@ -177,6 +177,19 @@ $(function() {
}
});
// global keyboard shortcuts
$(document).on('keypress', function(ev) {
var element = ev.target;
if (element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable) {
return true; // let it handle
}
if (ev.key == 'm') {
// m: open modify/comment section
$('.contextual .icon-edit').last().trigger('click');
}
return true;
});
function handle_jobs(jobs) {
$(jobs).each(function(idx, job) {
if (job.name.indexOf('wip%2F' + issue_no) == 0) {