Skip to content
Extraits de code Groupes Projets
Valider f976d9f5 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #6452 remove existing notification before creating new one

parent 4f032c89
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
options = {}; options = {};
} }
closeExistingNotificationHavingSameIdIfNeeded(options);
var template = generateNotificationHtmlMarkup(options, message); var template = generateNotificationHtmlMarkup(options, message);
this.$node = placeNotification(template, options); this.$node = placeNotification(template, options);
}; };
...@@ -108,4 +110,17 @@ ...@@ -108,4 +110,17 @@
return $notificationNode; return $notificationNode;
} }
function closeExistingNotificationHavingSameIdIfNeeded(options)
{
if (!options.id) {
return;
}
var $existingNode = $('[notification-id=' + options.id + ']');
if ($existingNode && $existingNode.length) {
$existingNode.remove();
}
}
})(jQuery, require); })(jQuery, require);
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter