stop notification click event propagation
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12" ng-click="notification.isCollapsed = !notification.isCollapsed" ng-class="{ 'notification-details': notification.detailsShown }">
|
||||
{{ notification.title }} <small class="text-muted" uib-tooltip="{{ notification.creationTime | prettyLongDate }}">{{ notification.creationTime | prettyDate }}</small>
|
||||
<button class="btn btn-xs btn-success pull-right" ng-hide="notification.acknowledged" ng-click="notifications.ack(notification)" uib-tooltip="Clear"><i class="fa fa-check"></i></button>
|
||||
<button class="btn btn-xs btn-success pull-right" ng-hide="notification.acknowledged" ng-click="notifications.ack(notification, $event)" uib-tooltip="Clear"><i class="fa fa-check"></i></button>
|
||||
|
||||
<div uib-collapse="notification.isCollapsed" expanding="notificationExpanding(notification)">
|
||||
<br/>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user