Welcome to mirror list, hosted at ThFree Co, Russian Federation.

docs_bundle.js « docs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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);