Commit 08d9421dd9c291def896c78f703fec933d1c540f

Authored by Nihad Abbasov
1 parent 60e18e26

rewrite graph.js in coffeescript

app/assets/javascripts/graph.js
... ... @@ -1,10 +0,0 @@
1   -function initGraphNav() {
2   - $(".graph svg").css("position", "relative");
3   - $("body").bind("keyup", function(e) {
4   - if(e.keyCode == 37) { // left
5   - $(".graph svg").animate({ left: "+=400" });
6   - } else if(e.keyCode == 39) { // right
7   - $(".graph svg").animate({ left: "-=400" });
8   - }
9   - });
10   -}
app/assets/javascripts/graph.js.coffee 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +initGraphNav = ->
  2 + $('.graph svg').css 'position', 'relative'
  3 +
  4 + $('body').bind 'keyup', (e) ->
  5 + if e.keyCode is 37 # left
  6 + $('.graph svg').animate left: '+=400'
  7 + else if e.keyCode is 39 # right
  8 + $('.graph svg').animate left: '-=400'
  9 +
  10 +window.initGraphNav = initGraphNav
... ...