summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-27 02:48:15 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-27 02:48:15 +0200
commit42f6dc686f313ba294e3cbcfb0ebde50678580fe (patch)
treedc14152cc8c98895f800c84cd2737fe6a5b22b7f /client/components
parent40c2411f2a1ce0bbd177f377828f9d6700112b06 (diff)
downloadwekan-42f6dc686f313ba294e3cbcfb0ebde50678580fe.tar.gz
wekan-42f6dc686f313ba294e3cbcfb0ebde50678580fe.tar.bz2
wekan-42f6dc686f313ba294e3cbcfb0ebde50678580fe.zip
Prioritize escape actions with a label hierarchy instead of an integer
Diffstat (limited to 'client/components')
-rw-r--r--client/components/boards/router.js2
-rw-r--r--client/components/forms/inlinedform.js6
-rw-r--r--client/components/main/editor.js2
-rw-r--r--client/components/sidebar/sidebar.js2
4 files changed, 5 insertions, 7 deletions
diff --git a/client/components/boards/router.js b/client/components/boards/router.js
index 80fadd9e..81fc3d91 100644
--- a/client/components/boards/router.js
+++ b/client/components/boards/router.js
@@ -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')); }
);
diff --git a/client/components/forms/inlinedform.js b/client/components/forms/inlinedform.js
index 200a6f9d..b84952d2 100644
--- a/client/components/forms/inlinedform.js
+++ b/client/components/forms/inlinedform.js
@@ -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(); }
);
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 95a8dc5d..a35ecd06 100644
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -60,7 +60,7 @@ Template.editor.onRendered(function() {
});
});
-EscapeActions.register(10,
+EscapeActions.register('textcomplete',
function() { return dropdownMenuIsOpened; },
function() {}
);
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 729bc42b..ce7925ea 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -97,7 +97,7 @@ BlazeComponent.extendComponent({
}
}).register('sidebar');
-EscapeActions.register(40,
+EscapeActions.register('sidebarView',
function() { return Sidebar && Sidebar.getView() !== defaultView; },
function() { Sidebar.setView(defaultView); }
);