diff options
author | Chad Jolly <cjolly@lawgical.com> | 2013-07-20 14:09:51 -0600 |
---|---|---|
committer | Chad Jolly <cjolly@lawgical.com> | 2013-07-27 14:20:35 -0600 |
commit | 60dcd73bac913afe0a49b6c6c07b709aa288fd7d (patch) | |
tree | a13ef1881757e2e361d0045f42dd49e7cd7bffed /javascripts | |
parent | 5f8cbcb7debde027e79d87733b84cb852aa47dad (diff) |
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
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 9 |
1 files changed, 4 insertions, 5 deletions
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() |