mirror of
https://github.com/wekan/wekan.git
synced 2026-02-02 06:31:47 +01:00
Prioritize escape actions with a label hierarchy instead of an integer
This commit is contained in:
parent
40c2411f2a
commit
42f6dc686f
6 changed files with 34 additions and 16 deletions
|
|
@ -57,7 +57,7 @@ Router.route('/boards/:boardId/:slug/:cardId', {
|
|||
});
|
||||
|
||||
// Close the card details pane by pressing escape
|
||||
EscapeActions.register(50,
|
||||
EscapeActions.register('detailedPane',
|
||||
function() { return ! Session.equals('currentCard', null); },
|
||||
function() { Utils.goBoardId(Session.get('currentBoard')); }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@
|
|||
// keyboard.js
|
||||
var currentlyOpenedForm = new ReactiveVar(null);
|
||||
|
||||
var inlinedFormEscapePriority = 30;
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
template: function() {
|
||||
return 'inlinedForm';
|
||||
|
|
@ -37,7 +35,7 @@ BlazeComponent.extendComponent({
|
|||
// if (currentlyOpenedForm.get() !== null) {
|
||||
// currentlyOpenedForm.get().close();
|
||||
// }
|
||||
EscapeActions.executeLowerThan(inlinedFormEscapePriority);
|
||||
EscapeActions.executeLowerThan('inlinedForm');
|
||||
this.isOpen.set(true);
|
||||
currentlyOpenedForm.set(this);
|
||||
},
|
||||
|
|
@ -97,7 +95,7 @@ BlazeComponent.extendComponent({
|
|||
}).register('inlinedForm');
|
||||
|
||||
// Press escape to close the currently opened inlinedForm
|
||||
EscapeActions.register(inlinedFormEscapePriority,
|
||||
EscapeActions.register('inlinedForm',
|
||||
function() { return currentlyOpenedForm.get() !== null; },
|
||||
function() { currentlyOpenedForm.get().close(); }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ Template.editor.onRendered(function() {
|
|||
});
|
||||
});
|
||||
|
||||
EscapeActions.register(10,
|
||||
EscapeActions.register('textcomplete',
|
||||
function() { return dropdownMenuIsOpened; },
|
||||
function() {}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
}).register('sidebar');
|
||||
|
||||
EscapeActions.register(40,
|
||||
EscapeActions.register('sidebarView',
|
||||
function() { return Sidebar && Sidebar.getView() !== defaultView; },
|
||||
function() { Sidebar.setView(defaultView); }
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue