Commit df2dd1b0 authored by Kjetil Thuen's avatar Kjetil Thuen
Browse files

Added a top level script for initiating the chart

parent 6b47a872
timebars = require './timebars.coffee'
nesstarloader = require './nesstarloader.coffee'
completeData = {}
timeBarAnim = undefined
window.nesstartimebars = {}
window.nesstartimebars.main = (containerId) ->
nesstarloader.reloadNesstarData( (foo) ->
completeData = foo
timebars.setupChart containerId, completeData
)
window.nesstartimebars.toggleAnimation = (containerId) ->
if timeBarAnim?
clearInterval window.timeBarAnim
timeBarAnim = undefined
document.getElementById("playBtn")
.innerHTML = "<i class='fa fa-play'></i>"
else
timeBarAnim = setInterval ->
timebars.setFrame containerId
, timebars.speed()
document.getElementById("playBtn")
.innerHTML = "<i class='fa fa-pause'></i>"
timebars.setupChart containerId, window.data
undefined
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment