summaryrefslogtreecommitdiff
path: root/javascripts
diff options
context:
space:
mode:
authorAdam Byrtek <adambyrtek@gmail.com>2015-02-24 20:18:14 +0000
committerAdam Byrtek <adambyrtek@gmail.com>2015-02-24 20:18:14 +0000
commit6914d99bda53f7732988a61b639165b54d9b8cfd (patch)
tree36a1f4b45695f35df96ba597d7b103b5dc170cd5 /javascripts
parentf4b121e8dead69e02223ee9d50e431dbc7f5b3c5 (diff)
Trigger onData on widget initialization
Diffstat (limited to 'javascripts')
-rw-r--r--javascripts/dashing.coffee7
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}")