Skip to content

Commit

Permalink
stop propagation when closing cheatSheet with esc key
Browse files Browse the repository at this point in the history
  • Loading branch information
djeremh committed Aug 27, 2015
1 parent 7704d89 commit 3826fe9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-hotkeys",
"version": "1.4.7",
"version": "1.4.8",
"main": [
"build/hotkeys.min.js",
"build/hotkeys.min.css"
Expand Down
7 changes: 6 additions & 1 deletion build/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@
// Here's an odd way to do this: we're going to use the original
// description of the hotkey on the cheat sheet so that it shows up.
// without it, no entry for esc will ever show up (#22)
_add('esc', previousEsc.description, toggleCheatSheet, null, ['INPUT', 'SELECT', 'TEXTAREA']);
_add('esc', previousEsc.description, function(event) {
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
toggleCheatSheet();
}, null, ['INPUT', 'SELECT', 'TEXTAREA']);
} else {
_del('esc');

Expand Down
Loading

0 comments on commit 3826fe9

Please sign in to comment.