diff --git a/core/client/views/base.js b/core/client/views/base.js index aa93b16087e6..a4bc1636b65a 100644 --- a/core/client/views/base.js +++ b/core/client/views/base.js @@ -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',