diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-04-06 10:10:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 10:10:40 +0300 |
commit | bc6ec46620be2805792da6fdfe5f541f9134ca7f (patch) | |
tree | c9e189a5621cf254f7b899966e9f5339c608abd8 | |
parent | 2f772adc50a11bac32967764ba68d4e3b7a18740 (diff) |
Ensure at least one notification with the same id remains (#15773)
-rw-r--r-- | plugins/CoreHome/angularjs/notification/notification.directive.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/CoreHome/angularjs/notification/notification.directive.js b/plugins/CoreHome/angularjs/notification/notification.directive.js index 3be9273ca8..d8867c04c0 100644 --- a/plugins/CoreHome/angularjs/notification/notification.directive.js +++ b/plugins/CoreHome/angularjs/notification/notification.directive.js @@ -87,8 +87,9 @@ function closeExistingNotificationHavingSameIdIfNeeded(id, notificationElement) { // TODO: instead of doing a global query for notification, there should be a notification-container // directive that manages notifications. + var notificationStillExists = !!notificationElement.parents('body').length; var existingNode = angular.element('[notification-id=' + id + ']').not(notificationElement); - if (existingNode && existingNode.length) { + if (notificationStillExists && existingNode && existingNode.length) { existingNode.remove(); } } |