gitlab-org--gitlab-foss/app/assets/javascripts/docs/docs_bundle.js

14 lines
388 B
JavaScript
Raw Normal View History

2017-12-19 11:18:48 -05:00
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);