Skip to content

Commit

Permalink
Merge pull request #1894 from ErisDS/issue-1558
Browse files Browse the repository at this point in the history
Notifications can be dismissed with ESC
  • Loading branch information
ErisDS committed Jan 9, 2014
2 parents 117f3c9 + eae2147 commit c833946
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/client/views/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@
Ghost.on('urlchange', function () {
self.clearEverything();
});
shortcut.add("ESC", function () {
// Make sure there isn't currently an open modal, as the escape key should close that first.
// This is a temporary solution to enable closing extra-long notifications, and should be refactored
// into something more robust in future
if ($('.js-modal').length < 1) {
self.clearEverything();
}
});
},
events: {
'animationend .js-notification': 'removeItem',
Expand Down

0 comments on commit c833946

Please sign in to comment.