From 3eb4d2c341b712268bd321173909e0a7b19a88c9 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Fri, 28 Jun 2019 12:52:09 -0500 Subject: Prettier & eslint project style update --- client/lib/keyboard.js | 67 +++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'client/lib/keyboard.js') diff --git a/client/lib/keyboard.js b/client/lib/keyboard.js index 7abfa88d..d3f974be 100755 --- a/client/lib/keyboard.js +++ b/client/lib/keyboard.js @@ -40,8 +40,10 @@ Mousetrap.bind(['down', 'up'], (evt, key) => { return; } - const nextFunc = (key === 'down' ? 'next' : 'prev'); - const nextCard = $('.js-minicard.is-selected')[nextFunc]('.js-minicard').get(0); + 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); @@ -49,7 +51,7 @@ Mousetrap.bind(['down', 'up'], (evt, key) => { }); // XXX This shortcut should also work when hovering over a card in board view -Mousetrap.bind('space', (evt) => { +Mousetrap.bind('space', evt => { if (!Session.get('currentCard')) { return; } @@ -69,29 +71,38 @@ Mousetrap.bind('space', (evt) => { }); Template.keyboardShortcuts.helpers({ - mapping: [{ - keys: ['W'], - action: 'shortcut-toggle-sidebar', - }, { - keys: ['Q'], - action: 'shortcut-filter-my-cards', - }, { - keys: ['F'], - action: 'shortcut-toggle-filterbar', - }, { - keys: ['X'], - action: 'shortcut-clear-filters', - }, { - keys: ['?'], - action: 'shortcut-show-shortcuts', - }, { - keys: ['ESC'], - action: 'shortcut-close-dialog', - }, { - keys: ['@'], - action: 'shortcut-autocomplete-members', - }, { - keys: ['SPACE'], - action: 'shortcut-assign-self', - }], + mapping: [ + { + keys: ['W'], + action: 'shortcut-toggle-sidebar', + }, + { + keys: ['Q'], + action: 'shortcut-filter-my-cards', + }, + { + keys: ['F'], + action: 'shortcut-toggle-filterbar', + }, + { + keys: ['X'], + action: 'shortcut-clear-filters', + }, + { + keys: ['?'], + action: 'shortcut-show-shortcuts', + }, + { + keys: ['ESC'], + action: 'shortcut-close-dialog', + }, + { + keys: ['@'], + action: 'shortcut-autocomplete-members', + }, + { + keys: ['SPACE'], + action: 'shortcut-assign-self', + }, + ], }); -- cgit v1.2.3-1-g7c22