debian-mirror-gitlab/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js

16 lines
544 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import Mousetrap from 'mousetrap';
import ShortcutsNavigation from './shortcuts_navigation';
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
export default class ShortcutsNetwork extends ShortcutsNavigation {
constructor(graph) {
super();
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
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);
}
}