2017-12-19 05:12:32 -05:00
|
|
|
import Mousetrap from 'mousetrap';
|
2017-10-10 05:10:11 -04:00
|
|
|
import ShortcutsNavigation from './shortcuts_navigation';
|
2016-07-24 16:45:11 -04:00
|
|
|
|
2017-10-10 05:10:11 -04:00
|
|
|
export default class ShortcutsNetwork extends ShortcutsNavigation {
|
|
|
|
constructor(graph) {
|
|
|
|
super();
|
2016-07-24 16:45:11 -04:00
|
|
|
|
2017-10-10 05:10:11 -04:00
|
|
|
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);
|
2016-07-24 16:45:11 -04:00
|
|
|
|
2017-10-10 05:10:11 -04:00
|
|
|
this.enabledHelp.push('.hidden-shortcut.network');
|
|
|
|
}
|
|
|
|
}
|