stop notification click event propagation

This commit is contained in:
Johannes Zellner
2019-02-28 15:56:19 +01:00
parent c25c3e9daa
commit d09ac5bcc6
2 changed files with 5 additions and 3 deletions

View File

@@ -44,9 +44,11 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
$scope.notifications.activeNotification = notification;
},
ack: function (notification, callback) {
ack: function (notification, event, callback) {
callback = callback || function (error) { if (error) console.error(error); };
if (event) event.stopPropagation();
Client.ackNotification(notification.id, function (error) {
if (error) return callback(error);
@@ -66,7 +68,7 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
asyncForEach($scope.notifications.notifications, function (notification, callback) {
if (notification.acknowledged) return callback();
$scope.notifications.ack(notification, callback);
$scope.notifications.ack(notification, null /* no click event */, callback);
}, function (error) {
if (error) console.error(error);