2017-12-19 11:18:48 -05:00
|
|
|
import Mousetrap from 'mousetrap';
|
|
|
|
|
|
|
|
function addMousetrapClick(el, key) {
|
|
|
|
el.addEventListener('click', () => Mousetrap.trigger(key));
|
|
|
|
}
|
|
|
|
|
2018-02-21 15:22:56 -05:00
|
|
|
export default () => {
|
2017-12-19 11:18:48 -05:00
|
|
|
addMousetrapClick(document.querySelector('.js-trigger-shortcut'), '?');
|
|
|
|
addMousetrapClick(document.querySelector('.js-trigger-search-bar'), 's');
|
2018-02-21 15:22:56 -05:00
|
|
|
};
|