diff options
Diffstat (limited to 'client/lib/popup.js')
-rw-r--r-- | client/lib/popup.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/client/lib/popup.js b/client/lib/popup.js index 84d4b63a..6435eac6 100644 --- a/client/lib/popup.js +++ b/client/lib/popup.js @@ -194,9 +194,14 @@ Popup = { // We close a potential opened popup on any left click on the document, or go // one step back by pressing escape. -EscapeActions.register('popup', - function(evt) { Popup[evt.type === 'click' ? 'close' : 'back'](); }, - _.bind(Popup.isOpen, Popup), { - noClickEscapeOn: '.js-pop-over' - } -); +var escapeActions = ['back', 'close']; +_.each(escapeActions, function(actionName) { + EscapeActions.register('popup-' + actionName, + _.bind(Popup[actionName], Popup), + _.bind(Popup.isOpen, Popup), { + noClickEscapeOn: '.js-pop-over', + enabledOnClick: actionName === 'close' + } + ); +}); + |