diff options
author | Varac <varac@leap.se> | 2017-10-16 14:21:55 +0200 |
---|---|---|
committer | Varac <varac@leap.se> | 2017-10-16 14:21:55 +0200 |
commit | c3e807eb42ea7389676b714584bde204eab18577 (patch) | |
tree | d9ac909ff468ff2f00f03a29ab3f9b4ba05a56a7 /javascripts | |
parent | 64a3927db5440fe2c9b5c4d02667cb0749884c40 (diff) | |
parent | 2917ad9519d6f872d51582d335a147bf2e5f935e (diff) |
Merge branch 'upgrade_dashing'
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 20a9987..58218ae 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -46,7 +46,7 @@ class Dashing.Widget extends Batman.View @accessor 'updatedAtMessage', -> if updatedAt = @get('updatedAt') - timestamp = new Date(updatedAt * 1000) + timestamp = new Date(updatedAt) hours = timestamp.getHours() minutes = ("0" + timestamp.getMinutes()).slice(-2) "Last updated at #{hours}:#{minutes}" @@ -57,16 +57,22 @@ class Dashing.Widget extends Batman.View # In case the events from the server came before the widget was rendered lastData = Dashing.lastEvents[@id] if lastData + lastData = @select(lastData) @mixin(lastData) @onData(lastData) receiveData: (data) => + data = @select(data) @mixin(data) @onData(data) onData: (data) => # Widgets override this to handle incoming data + select: (data) => + # Widgets override this to transform data before it is applied to the model + return data + Dashing.AnimatedValue = get: Batman.Property.defaultAccessor.get set: (k, to) -> |