BigW Consortium Gitlab

docs_bundle.js 388 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
import Mousetrap from 'mousetrap';

function addMousetrapClick(el, key) {
  el.addEventListener('click', () => Mousetrap.trigger(key));
}

function domContentLoaded() {
  addMousetrapClick(document.querySelector('.js-trigger-shortcut'), '?');
  addMousetrapClick(document.querySelector('.js-trigger-search-bar'), 's');
}

document.addEventListener('DOMContentLoaded', domContentLoaded);