diff options
author | Adam Byrtek <adambyrtek@gmail.com> | 2015-02-24 20:18:14 +0000 |
---|---|---|
committer | Adam Byrtek <adambyrtek@gmail.com> | 2015-02-24 20:18:14 +0000 |
commit | 6914d99bda53f7732988a61b639165b54d9b8cfd (patch) | |
tree | 36a1f4b45695f35df96ba597d7b103b5dc170cd5 | |
parent | f4b121e8dead69e02223ee9d50e431dbc7f5b3c5 (diff) |
Trigger onData on widget initialization
-rw-r--r-- | javascripts/dashing.coffee | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index e5875d8..c66128d 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -40,7 +40,12 @@ class Dashing.Widget extends Batman.View @mixin($(@node).data()) Dashing.widgets[@id] ||= [] Dashing.widgets[@id].push(@) - @mixin(Dashing.lastEvents[@id]) # in case the events from the server came before the widget was rendered + + # 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}") |