From: David ‘Bombe’ Roden Date: Thu, 20 Jan 2011 06:00:42 +0000 (+0100) Subject: When replacing a notification, remember whether it was opened or not. X-Git-Tag: 0.4.2^2~19 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=818fcaeb843238ec7bee69862d32ee4511f76604 When replacing a notification, remember whether it was opened or not. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index a0bbf8a..06e5daf 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -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);