From eae21472659f20d75f6d55f27ca1e5a15b2f7d19 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 9 Jan 2014 14:40:24 +0000 Subject: [PATCH] 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. --- core/client/views/base.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/client/views/base.js b/core/client/views/base.js index aa93b16087..a4bc1636b6 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',