rewrite graph.js in coffeescript
This commit is contained in:
parent
60e18e2636
commit
08d9421dd9
2 changed files with 10 additions and 10 deletions
10
app/assets/javascripts/graph.js.coffee
Normal file
10
app/assets/javascripts/graph.js.coffee
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue