diff options
Diffstat (limited to 'extensions/BugModal')
-rw-r--r-- | extensions/BugModal/web/bug_modal.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index babbdbe14..bd529fab1 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -732,16 +732,17 @@ $(function() { .change(); // hotkeys - $('body').hotkey('ctrl+e', function() { - if ($('#cancel-btn:visible').length == 0) { - $('#mode-btn').click(); - } - } ); - $('body').hotkey('escape', function() { - if ($('#cancel-btn:visible').length != 0) { - $('#cancel-btn').click(); - } - } ); + $(window) + .keydown(function(event) { + if (!(event.ctrlKey || event.metaKey)) + return; + if (String.fromCharCode(event.which).toLowerCase() == 'e') { + if ($('#cancel-btn:visible').length == 0) { + event.preventDefault(); + $('#mode-btn').click(); + } + } + }); // add cc button $('#add-cc-btn') |