When replacing a notification, remember whether it was opened or not.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 20 Jan 2011 06:00:42 +0000 (07:00 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 20 Jan 2011 06:00:42 +0000 (07:00 +0100)
src/main/resources/static/javascript/sone.js

index a0bbf8a..06e5daf 100644 (file)
@@ -726,6 +726,11 @@ function getStatus() {
                                oldNotification = $("#sone #notification-area .notification#" + value.id);
                                notification = ajaxifyNotification(createNotification(value.id, value.text, value.dismissable)).hide();
                                if (oldNotification.length != 0) {
+                                       if (oldNotification.find(".short-text").length > 0) {
+                                               opened = !oldNotification.find(".short-text").hasClass("hidden");
+                                               notification.find(".short-text").toggleClass("hidden", opened);
+                                               notification.find(".text").toggleClass("hidden", !opened);
+                                       }
                                        oldNotification.replaceWith(notification.show());
                                } else {
                                        $("#sone #notification-area").append(notification);