diff --git a/app/modules/notifications/notifications.controller.coffee b/app/modules/notifications/notifications.controller.coffee index bcc63d66..69b9236a 100644 --- a/app/modules/notifications/notifications.controller.coffee +++ b/app/modules/notifications/notifications.controller.coffee @@ -42,7 +42,8 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t @.loadNotifications() @rootScope.$on "notifications:updated", (event) => - @.reloadList() + if @.onlyUnread + @.reloadList() initList: ()-> @.notificationsList = Immutable.List() @@ -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")