Click on the page to escape the last action

This is a generalization of what we had for closing a popup by
clicking outside of it. It now works for inlinedForms and detailsPane
as well.
This commit is contained in:
Maxime Quandalle 2015-06-07 10:30:27 +02:00
parent 12919cbfc6
commit 92dd05d06d
17 changed files with 199 additions and 145 deletions

View file

@ -78,7 +78,7 @@ MultiSelection = {
activate: function() {
if (! this.isActive()) {
EscapeActions.executeLowerThan('detailsPane');
EscapeActions.executeUpTo('detailsPane');
this._isActive.set(true);
Sidebar.setView(this.sidebarView);
Tracker.flush();
@ -91,6 +91,7 @@ MultiSelection = {
if (Sidebar && Sidebar.getView() === this.sidebarView) {
Sidebar.setView();
}
this.reset();
}
},
@ -149,11 +150,7 @@ MultiSelection = {
Blaze.registerHelper('MultiSelection', MultiSelection);
EscapeActions.register('multiselection-disable',
EscapeActions.register('multiselection',
function() { MultiSelection.disable(); },
function() { return MultiSelection.isActive(); }
);
EscapeActions.register('multiselection-reset',
function() { MultiSelection.reset(); }
);