Improve notification click redirect

stable
Daniel García 2018-11-26 13:48:39 +01:00 committed by Alex Hermida
parent 0f0ef0c983
commit 254e7384cb
1 changed files with 4 additions and 4 deletions

View File

@ -42,6 +42,7 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t
@.loadNotifications()
@rootScope.$on "notifications:updated", (event) =>
if @.onlyUnread
@.reloadList()
initList: ()->
@ -73,15 +74,14 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t
return @.notificationsList
setAsRead: (notification, url) ->
@.loading = true
@scope.$emit("notifications:loading")
@notificationsService.setNotificationAsRead(notification.get("id")).then =>
if @location.$$url == url
@window.location.reload()
else
@rootScope.$broadcast "notifications:updated"
@location.path(url)
@rootScope.$broadcast "notifications:updated"
setAllAsRead: () ->
@.loading = true
@scope.$emit("notifications:loading")