summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-09-06 04:32:31 -0700
committerNihad Abbasov <narkoz.2008@gmail.com>2012-09-06 04:32:31 -0700
commit08d9421dd9c291def896c78f703fec933d1c540f (patch)
tree22ad42beb444646f7090b550f02dc5dba5d1115b
parent60e18e2636b8ca3e6f25c5a9adaa4118f5a2d3ad (diff)
downloadgitlab-ce-08d9421dd9c291def896c78f703fec933d1c540f.tar.gz
rewrite graph.js in coffeescript
-rw-r--r--app/assets/javascripts/graph.js10
-rw-r--r--app/assets/javascripts/graph.js.coffee10
2 files changed, 10 insertions, 10 deletions
diff --git a/app/assets/javascripts/graph.js b/app/assets/javascripts/graph.js
deleted file mode 100644
index 434cf70ac65..00000000000
--- a/app/assets/javascripts/graph.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function initGraphNav() {
- $(".graph svg").css("position", "relative");
- $("body").bind("keyup", function(e) {
- if(e.keyCode == 37) { // left
- $(".graph svg").animate({ left: "+=400" });
- } else if(e.keyCode == 39) { // right
- $(".graph svg").animate({ left: "-=400" });
- }
- });
-}
diff --git a/app/assets/javascripts/graph.js.coffee b/app/assets/javascripts/graph.js.coffee
new file mode 100644
index 00000000000..5fe8ae3f020
--- /dev/null
+++ b/app/assets/javascripts/graph.js.coffee
@@ -0,0 +1,10 @@
+initGraphNav = ->
+ $('.graph svg').css 'position', 'relative'
+
+ $('body').bind 'keyup', (e) ->
+ if e.keyCode is 37 # left
+ $('.graph svg').animate left: '+=400'
+ else if e.keyCode is 39 # right
+ $('.graph svg').animate left: '-=400'
+
+window.initGraphNav = initGraphNav