diff options
Diffstat (limited to 'app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js')
-rw-r--r-- | app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js index c33c092b009..02c6af53fc2 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js @@ -1,6 +1,4 @@ -import Mousetrap from 'mousetrap'; import { - keysFor, REPO_GRAPH_SCROLL_BOTTOM, REPO_GRAPH_SCROLL_DOWN, REPO_GRAPH_SCROLL_LEFT, @@ -14,11 +12,13 @@ export default class ShortcutsNetwork extends ShortcutsNavigation { constructor(graph) { super(); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_LEFT), graph.scrollLeft); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_RIGHT), graph.scrollRight); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_UP), graph.scrollUp); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_DOWN), graph.scrollDown); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_TOP), graph.scrollTop); - Mousetrap.bind(keysFor(REPO_GRAPH_SCROLL_BOTTOM), graph.scrollBottom); + this.bindCommands([ + [REPO_GRAPH_SCROLL_LEFT, graph.scrollLeft], + [REPO_GRAPH_SCROLL_RIGHT, graph.scrollRight], + [REPO_GRAPH_SCROLL_UP, graph.scrollUp], + [REPO_GRAPH_SCROLL_DOWN, graph.scrollDown], + [REPO_GRAPH_SCROLL_TOP, graph.scrollTop], + [REPO_GRAPH_SCROLL_BOTTOM, graph.scrollBottom], + ]); } } |