mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Notifications can be dismissed with ESC
issue #1558 - this is a partial / short term fix for the problem with extra long notifications, so that there is at least one way to remove them.
This commit is contained in:
parent
fecb392afa
commit
eae2147265
1 changed files with 8 additions and 0 deletions
|
@ -161,6 +161,14 @@
|
||||||
Ghost.on('urlchange', function () {
|
Ghost.on('urlchange', function () {
|
||||||
self.clearEverything();
|
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: {
|
events: {
|
||||||
'animationend .js-notification': 'removeItem',
|
'animationend .js-notification': 'removeItem',
|
||||||
|
|
Loading…
Add table
Reference in a new issue