Replace existing notifications seamlessly instead of sliding stuff around.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 07:55:49 +0000 (08:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 07:55:49 +0000 (08:55 +0100)
src/main/resources/static/javascript/sone.js

index a7bfe08..bbac57d 100644 (file)
@@ -508,12 +508,11 @@ function getNotifications() {
                                oldNotification = $("#sone #notification-area .notification#" + value.id);
                                notification = ajaxifyNotification(createNotification(value.id, value.text, value.dismissable)).hide();
                                if (oldNotification.length != 0) {
-                                       oldNotification.slideUp();
-                                       notification.insertBefore(oldNotification);
+                                       oldNotification.replaceWith(notification.show());
                                } else {
                                        $("#sone #notification-area").append(notification);
+                                       notification.slideDown();
                                }
-                               notification.slideDown();
                        });
                        $.each(data.removedNotifications, function(index, value) {
                                $("#sone #notification-area .notification#" + value.id).slideUp();