diff options
Diffstat (limited to 'vendor/javascripts/widget.coffee')
-rw-r--r-- | vendor/javascripts/widget.coffee | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/javascripts/widget.coffee b/vendor/javascripts/widget.coffee new file mode 100644 index 0000000..9eb37d9 --- /dev/null +++ b/vendor/javascripts/widget.coffee @@ -0,0 +1,14 @@ +class AllTheThings.Widget extends Batman.View + constructor: -> + super + + @mixin($(@node).data()) + AllTheThings.widgets[@id] ||= [] + AllTheThings.widgets[@id].push(@) + @mixin(AllTheThings.lastEvents[@id]) # in case the events from the server came before the widget was rendered + + type = Batman.Filters.underscore(@view) + $(@node).addClass("widget #{type} #{@id}") + + onData: (data) => + @mixin(data)
\ No newline at end of file |