Implement a new system to handle "escape actions"

The new EscapeActions object decide what to do when the user press the
Escape key (such as closing a opened popup or inlined form).

This commit also re-introduced the sidebar current view as a sidebar
component local state.
This commit is contained in:
Maxime Quandalle 2015-05-26 20:30:01 +02:00
parent 1b4fcc67f4
commit 40c2411f2a
13 changed files with 148 additions and 53 deletions

View file

@ -201,3 +201,7 @@ $(document).on('click', function(evt) {
Popup.close();
}
});
// Press escape to close the popup.
var bindPopup = function(f) { return _.bind(f, Popup); };
EscapeActions.register(20, bindPopup(Popup.isOpen), bindPopup(Popup.close));