Add keyboard shortcut for search

This commit is contained in:
helioguardabaxo 2020-11-16 19:20:57 -03:00
parent 5e03507eba
commit 69fc2cd8f8
2 changed files with 13 additions and 0 deletions

View file

@ -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',

View file

@ -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",