debian-mirror-gitlab/app/assets/javascripts/docs/docs_bundle.js
2018-03-27 19:54:05 +05:30

10 lines
315 B
JavaScript

import Mousetrap from 'mousetrap';
function addMousetrapClick(el, key) {
el.addEventListener('click', () => Mousetrap.trigger(key));
}
export default () => {
addMousetrapClick(document.querySelector('.js-trigger-shortcut'), '?');
addMousetrapClick(document.querySelector('.js-trigger-search-bar'), 's');
};