gitlab-org--gitlab-foss/app/assets/javascripts/shortcuts_network.js
2017-10-13 11:38:09 +01:00

17 lines
588 B
JavaScript

/* global Mousetrap */
import ShortcutsNavigation from './shortcuts_navigation';
export default class ShortcutsNetwork extends ShortcutsNavigation {
constructor(graph) {
super();
Mousetrap.bind(['left', 'h'], graph.scrollLeft);
Mousetrap.bind(['right', 'l'], graph.scrollRight);
Mousetrap.bind(['up', 'k'], graph.scrollUp);
Mousetrap.bind(['down', 'j'], graph.scrollDown);
Mousetrap.bind(['shift+up', 'shift+k'], graph.scrollTop);
Mousetrap.bind(['shift+down', 'shift+j'], graph.scrollBottom);
this.enabledHelp.push('.hidden-shortcut.network');
}
}