Replace existing notifications seamlessly instead of sliding stuff around.
[Sone.git] / 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();