Skip to content

Commit

Permalink
Integrate getName changes from @bielfrontera
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Jun 23, 2014
1 parent 3bca71e commit fa5d8d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion javascripts/dashing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Dashing.params = Batman.URI.paramsFromQuery(window.location.search.slice(1));
class Dashing.Widget extends Batman.View
constructor: ->
# Set the view path
@constructor::source = Batman.Filters.underscore(@constructor.name)
@constructor::source = Batman.Filters.underscore(getName())
super

@mixin($(@node).data())
Expand Down Expand Up @@ -62,6 +62,11 @@ class Dashing.Widget extends Batman.View
onData: (data) =>
# Widgets override this to handle incoming data

getName: () =>
funcNameRegex = /function ([^\(]{1,})\(/;
results = (funcNameRegex).exec(@constructor.toString())
if (results && results.length > 1) then results[1].trim() else ""

Dashing.AnimatedValue =
get: Batman.Property.defaultAccessor.get
set: (k, to) ->
Expand Down

0 comments on commit fa5d8d7

Please sign in to comment.