summaryrefslogtreecommitdiff
path: root/javascripts/dashing.coffee
diff options
context:
space:
mode:
authorVarac <varac@leap.se>2017-10-16 14:21:55 +0200
committerVarac <varac@leap.se>2017-10-16 14:21:55 +0200
commitc3e807eb42ea7389676b714584bde204eab18577 (patch)
treed9ac909ff468ff2f00f03a29ab3f9b4ba05a56a7 /javascripts/dashing.coffee
parent64a3927db5440fe2c9b5c4d02667cb0749884c40 (diff)
parent2917ad9519d6f872d51582d335a147bf2e5f935e (diff)
Merge branch 'upgrade_dashing'
Diffstat (limited to 'javascripts/dashing.coffee')
-rw-r--r--javascripts/dashing.coffee8
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) ->