mirror of
https://github.com/wekan/wekan.git
synced 2026-03-04 21:00:16 +01:00
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:
parent
1b4fcc67f4
commit
40c2411f2a
13 changed files with 148 additions and 53 deletions
|
|
@ -39,7 +39,7 @@ Router.route('/boards/:boardId/:slug/:cardId', {
|
|||
template: 'board',
|
||||
onAfterAction: function() {
|
||||
Tracker.nonreactive(function() {
|
||||
if (! Session.get('currentCard') && typeof Sidebar !== 'undefined') {
|
||||
if (! Session.get('currentCard') && Sidebar) {
|
||||
Sidebar.hide();
|
||||
}
|
||||
});
|
||||
|
|
@ -55,3 +55,9 @@ Router.route('/boards/:boardId/:slug/:cardId', {
|
|||
return Boards.findOne(this.params.boardId);
|
||||
}
|
||||
});
|
||||
|
||||
// Close the card details pane by pressing escape
|
||||
EscapeActions.register(50,
|
||||
function() { return ! Session.equals('currentCard', null); },
|
||||
function() { Utils.goBoardId(Session.get('currentBoard')); }
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue