debian-mirror-gitlab/app/assets/javascripts/docs/docs_bundle.js

14 lines
388 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
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);