|
@@ -23,6 +23,14 @@ Mousetrap.bind('x', () => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+Mousetrap.bind('f', () => {
|
|
|
+ if (Sidebar.isOpen() && Sidebar.getView() === 'filter') {
|
|
|
+ Sidebar.toggle();
|
|
|
+ } else {
|
|
|
+ Sidebar.setView('filter');
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
Mousetrap.bind(['down', 'up'], (evt, key) => {
|
|
|
if (!Session.get('currentCard')) {
|
|
|
return;
|
|
@@ -36,6 +44,26 @@ Mousetrap.bind(['down', 'up'], (evt, key) => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+// XXX This shortcut should also work when hovering over a card in board view
|
|
|
+Mousetrap.bind('space', (evt) => {
|
|
|
+ if (!Session.get('currentCard')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const currentUserId = Meteor.userId();
|
|
|
+ if (currentUserId === null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Meteor.user().isBoardMember()) {
|
|
|
+ const card = Cards.findOne(Session.get('currentCard'));
|
|
|
+ card.toggleMember(currentUserId);
|
|
|
+ // We should prevent scrolling in card when spacebar is clicked
|
|
|
+ // This should do it according to Mousetrap docs, but it doesn't
|
|
|
+ evt.preventDefault();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
Template.keyboardShortcuts.helpers({
|
|
|
mapping: [{
|
|
|
keys: ['W'],
|
|
@@ -43,6 +71,9 @@ Template.keyboardShortcuts.helpers({
|
|
|
}, {
|
|
|
keys: ['Q'],
|
|
|
action: 'shortcut-filter-my-cards',
|
|
|
+ }, {
|
|
|
+ keys: ['F'],
|
|
|
+ action: 'shortcut-toggle-filterbar',
|
|
|
}, {
|
|
|
keys: ['X'],
|
|
|
action: 'shortcut-clear-filters',
|
|
@@ -58,5 +89,8 @@ Template.keyboardShortcuts.helpers({
|
|
|
}, {
|
|
|
keys: [':'],
|
|
|
action: 'shortcut-autocomplete-emojies',
|
|
|
+ }, {
|
|
|
+ keys: ['SPACE'],
|
|
|
+ action: 'shortcut-assign-self',
|
|
|
}],
|
|
|
});
|