diff --git a/static/js/dss/apps/notifications/views/notificationsListView.coffee b/static/js/dss/apps/notifications/views/notificationsListView.coffee index 28ecd3b..0cf4a42 100644 --- a/static/js/dss/apps/notifications/views/notificationsListView.coffee +++ b/static/js/dss/apps/notifications/views/notificationsListView.coffee @@ -14,6 +14,7 @@ notificationCount: "#notification-count" initialize: => + @listenTo App.vent, "model:notification:new", @initialize #quick and dirty check to see if user is logged in @collection = new App.NotificationApp.Models.NotificationCollection @collection.fetch( @@ -35,6 +36,7 @@ $(@ui.notificationCount).text(newCount + " new notifications") $(@ui.notificationCountBadge).show() $(@ui.notificationCountBadge).addClass('animate pulse') + console.log("Animating bell") $('#notification-icon', @el).addClass('icon-animated-bell') $(@ui.notificationCountBadge).text(newCount) diff --git a/static/js/dss/lib/realtimeController.coffee b/static/js/dss/lib/realtimeController.coffee index 36a5592..336ac79 100644 --- a/static/js/dss/lib/realtimeController.coffee +++ b/static/js/dss/lib/realtimeController.coffee @@ -8,25 +8,10 @@ @socket.on "connect", -> console.log("RealtimeController: Socket connected") - @socket.on "message", (message) -> - alert(message) - - @socket.on "server-session", (session) => - if session - console.log("RealtimeController: Connected " + sessionId) - sessionId = session['sessionId'] - @registerSessionWithServer sessionId - else - console.log("RealtimeController: Can't read sessionId from socket") - - @socket.on "activity", (data) => - console.log("RealtimeController: activity " + data['message']) - utils.showMessage("New activity", data['message']) - vent.trigger("model:activity:new", data['message']) - @socket.on "notification", (data) => console.log("RealtimeController: notification " + data['message']) - vent.trigger("model:notification:new", data['message']) + utils.showMessage("New activity", data['message']) + App.vent.trigger("model:notification:new", data['message']) else console.log("Realtime server unavailable")