summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/docs/docs_bundle.js
blob: a32bd6d0fc7652f5078b602fefc620f4e3b746fb (plain)
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);