diff options
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index f41a279..20a9987 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -41,12 +41,6 @@ class Dashing.Widget extends Batman.View Dashing.widgets[@id] ||= [] Dashing.widgets[@id].push(@) - # In case the events from the server came before the widget was rendered - lastData = Dashing.lastEvents[@id] - if lastData - @mixin(lastData) - @onData(lastData) - type = Batman.Filters.dashize(@view) $(@node).addClass("widget widget-#{type} #{@id}") @@ -60,6 +54,12 @@ class Dashing.Widget extends Batman.View @::on 'ready', -> Dashing.Widget.fire 'ready' + # In case the events from the server came before the widget was rendered + lastData = Dashing.lastEvents[@id] + if lastData + @mixin(lastData) + @onData(lastData) + receiveData: (data) => @mixin(data) @onData(data) |