diff options
author | Chad Jolly <cjolly@lawgical.com> | 2013-07-14 18:36:19 -0600 |
---|---|---|
committer | Chad Jolly <cjolly@lawgical.com> | 2013-07-14 18:36:19 -0600 |
commit | 5f8cbcb7debde027e79d87733b84cb852aa47dad (patch) | |
tree | 14113289a63f7039c792b7c1a2b645f0f36efd96 /javascripts | |
parent | 3f58bbd626cd84d1cb24375b4d8fe6df75ce85ba (diff) |
dashboard events - use SSE event names
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index f90c14b..c4178f3 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -106,10 +106,6 @@ source.addEventListener 'error', (e)-> source.addEventListener 'message', (e) -> data = JSON.parse(e.data) if lastEvents[data.id]?.updatedAt != data.updatedAt - # /messages are internal messages, and cannot correspond to widgets. - # We will handle them as events on the Dashing application. - return Dashing.fire(data.id.slice(1), data) if data.id[0] is '/' - if Dashing.debugMode console.log("Received data for #{data.id}", data) lastEvents[data.id] = data @@ -117,6 +113,11 @@ source.addEventListener 'message', (e) -> for widget in widgets[data.id] widget.receiveData(data) +source.addEventListener 'dashboards', (e) -> + data = JSON.parse(e.data) + if Dashing.debugMode + console.log("Received data for dashboards", data) + Dashing.fire data.event, data $(document).ready -> Dashing.run() |