blob: 066836d41bfd51404667653e91fa22f5d23f3178 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// XXX There is no reason to define these shortcuts globally, they should be
// attached to a template (most of them will go in the `board` template).
Mousetrap.bind('?', () => {
FlowRouter.go('shortcuts');
});
Mousetrap.bind('w', () => {
Sidebar.toogle();
});
Mousetrap.bind('q', () => {
const currentBoardId = Session.get('currentBoard');
const currentUserId = Meteor.userId();
if (currentBoardId && currentUserId) {
Filter.members.toogle(currentUserId);
}
});
Mousetrap.bind('x', () => {
if (Filter.isActive()) {
Filter.reset();
}
});
Mousetrap.bind(['down', 'up'], (evt, key) => {
if (! Session.get('currentCard')) {
return;
}
const nextFunc = (key === 'down' ? 'next' : 'prev');
const nextCard = $('.js-minicard.is-selected')[nextFunc]('.js-minicard').get(0);
if (nextCard) {
const nextCardId = Blaze.getData(nextCard)._id;
Utils.goCardId(nextCardId);
}
});
|