From 69fc2cd8f868aaaf0cc4301f66ce5ac89ed2c239 Mon Sep 17 00:00:00 2001 From: helioguardabaxo Date: Mon, 16 Nov 2020 19:20:57 -0300 Subject: [PATCH] Add keyboard shortcut for search --- client/lib/keyboard.js | 12 ++++++++++++ i18n/en.i18n.json | 1 + 2 files changed, 13 insertions(+) diff --git a/client/lib/keyboard.js b/client/lib/keyboard.js index e861e4161..9f35009d3 100755 --- a/client/lib/keyboard.js +++ b/client/lib/keyboard.js @@ -45,6 +45,14 @@ Mousetrap.bind('f', () => { } }); +Mousetrap.bind('/', () => { + if (Sidebar.isOpen() && Sidebar.getView() === 'search') { + Sidebar.toggle(); + } else { + Sidebar.setView('search'); + } +}); + Mousetrap.bind(['down', 'up'], (evt, key) => { if (!Session.get('currentCard')) { return; @@ -118,6 +126,10 @@ Template.keyboardShortcuts.helpers({ keys: ['f'], action: 'shortcut-toggle-filterbar', }, + { + keys: ['/'], + action: 'shortcut-toggle-searchbar', + }, { keys: ['x'], action: 'shortcut-clear-filters', diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 540715def..b11eb4bf0 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -488,6 +488,7 @@ "shortcut-filter-my-cards": "Filter my cards", "shortcut-show-shortcuts": "Bring up this shortcuts list", "shortcut-toggle-filterbar": "Toggle Filter Sidebar", + "shortcut-toggle-searchbar": "Toggle Search Sidebar", "shortcut-toggle-sidebar": "Toggle Board Sidebar", "show-cards-minimum-count": "Show cards count if list contains more than", "sidebar-open": "Open Sidebar",