Skip to content

Commit

Permalink
Dismiss keyboard shortcut help on Esc key
Browse files Browse the repository at this point in the history
  • Loading branch information
richieri-bps committed Aug 30, 2024
1 parent 46587e6 commit 9e71a76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions share/static/js/keyboard-shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ jQuery(function() {
modal.bind('modal:close', function() { modal.remove(); })
modal.on('hide.bs.modal', function() { modal.remove(); })
modal.modal('show');
// Dismiss modal when pressing ESC
Mousetrap.bind('esc', function() {
jQuery('.modal.keyboard-shortcuts .modal-header a.close').trigger('click');
// unbind the ESC key
Mousetrap.unbind('esc');
});
};

Mousetrap.bind('g b', goBack);
Expand Down

0 comments on commit 9e71a76

Please sign in to comment.