From 60dcd73bac913afe0a49b6c6c07b709aa288fd7d Mon Sep 17 00:00:00 2001 From: Chad Jolly Date: Sat, 20 Jul 2013 14:09:51 -0600 Subject: only fire dashboard events when target is current dashboard * send event to all dashboards by including {"dashboard": "*"} in payload * reload event forces reload from server, no caching --- javascripts/dashing.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'javascripts') diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index c4178f3..5712e98 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -26,10 +26,7 @@ Batman.Filters.shortenedNumber = (num) -> class window.Dashing extends Batman.App @on 'reload', (data) -> - if data.dashboard? - location.reload() if window.location.pathname is "/#{data.dashboard}" - else - location.reload() + window.location.reload(true) @root -> Dashing.params = Batman.URI.paramsFromQuery(window.location.search.slice(1)); @@ -89,6 +86,7 @@ Dashing.AnimatedValue = @[k] = num @set k, to , 10 + @[k] = num Dashing.widgets = widgets = {} Dashing.lastEvents = lastEvents = {} @@ -117,7 +115,8 @@ source.addEventListener 'dashboards', (e) -> data = JSON.parse(e.data) if Dashing.debugMode console.log("Received data for dashboards", data) - Dashing.fire data.event, data + if data.dashboard is '*' or window.location.pathname is "/#{data.dashboard}" + Dashing.fire data.event, data $(document).ready -> Dashing.run() -- cgit v1.2.3