Improve notification click redirect
parent
0f0ef0c983
commit
254e7384cb
|
@ -42,7 +42,8 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t
|
||||||
@.loadNotifications()
|
@.loadNotifications()
|
||||||
|
|
||||||
@rootScope.$on "notifications:updated", (event) =>
|
@rootScope.$on "notifications:updated", (event) =>
|
||||||
@.reloadList()
|
if @.onlyUnread
|
||||||
|
@.reloadList()
|
||||||
|
|
||||||
initList: ()->
|
initList: ()->
|
||||||
@.notificationsList = Immutable.List()
|
@.notificationsList = Immutable.List()
|
||||||
|
@ -73,15 +74,14 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t
|
||||||
return @.notificationsList
|
return @.notificationsList
|
||||||
|
|
||||||
setAsRead: (notification, url) ->
|
setAsRead: (notification, url) ->
|
||||||
@.loading = true
|
|
||||||
@scope.$emit("notifications:loading")
|
|
||||||
@notificationsService.setNotificationAsRead(notification.get("id")).then =>
|
@notificationsService.setNotificationAsRead(notification.get("id")).then =>
|
||||||
if @location.$$url == url
|
if @location.$$url == url
|
||||||
@window.location.reload()
|
@window.location.reload()
|
||||||
else
|
else
|
||||||
@rootScope.$broadcast "notifications:updated"
|
|
||||||
@location.path(url)
|
@location.path(url)
|
||||||
|
|
||||||
|
@rootScope.$broadcast "notifications:updated"
|
||||||
|
|
||||||
setAllAsRead: () ->
|
setAllAsRead: () ->
|
||||||
@.loading = true
|
@.loading = true
|
||||||
@scope.$emit("notifications:loading")
|
@scope.$emit("notifications:loading")
|
||||||
|
|
Loading…
Reference in New Issue