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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-07-24 23:45:11 +0300
committerFatih Acet <acetfatih@gmail.com>2016-07-24 23:45:11 +0300
commitaaa9509d120524573085e94af9de5cdde83e3271 (patch)
tree3824cffd4cdd132ee9cf75a00a7624f5ccc0dabd /app/assets/javascripts/shortcuts_network.js
parent56b79181adc0bd6e9abef97ea075c14be971a01a (diff)
ES6ify all the things!
Diffstat (limited to 'app/assets/javascripts/shortcuts_network.js')
-rw-r--r--app/assets/javascripts/shortcuts_network.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/assets/javascripts/shortcuts_network.js b/app/assets/javascripts/shortcuts_network.js
new file mode 100644
index 00000000000..fb2b39e757e
--- /dev/null
+++ b/app/assets/javascripts/shortcuts_network.js
@@ -0,0 +1,27 @@
+
+/*= require shortcuts_navigation */
+
+(function() {
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ this.ShortcutsNetwork = (function(superClass) {
+ extend(ShortcutsNetwork, superClass);
+
+ function ShortcutsNetwork(graph) {
+ this.graph = graph;
+ ShortcutsNetwork.__super__.constructor.call(this);
+ Mousetrap.bind(['left', 'h'], this.graph.scrollLeft);
+ Mousetrap.bind(['right', 'l'], this.graph.scrollRight);
+ Mousetrap.bind(['up', 'k'], this.graph.scrollUp);
+ Mousetrap.bind(['down', 'j'], this.graph.scrollDown);
+ Mousetrap.bind(['shift+up', 'shift+k'], this.graph.scrollTop);
+ Mousetrap.bind(['shift+down', 'shift+j'], this.graph.scrollBottom);
+ this.enabledHelp.push('.hidden-shortcut.network');
+ }
+
+ return ShortcutsNetwork;
+
+ })(ShortcutsNavigation);
+
+}).call(this);