X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=a3761b85f4c266b3e57eed596b8fd066b314c0d9;hb=d615555392317949e47f6367209ee7194f650768;hp=c0fbb6d9d7e5e0ff79460f1ad122667d8bbd198b;hpb=f0acfe87cd655eb2e15f1dd3bc590c1478e4e8ba;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index c0fbb6d..a3761b8 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -37,7 +37,8 @@ function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op (function(inputField, textarea) { inputField.focus(function() { $(this).hide().attr("disabled", "disabled"); - textarea.show().focus(); + /* no, show(), “display: block” is not what I need. */ + textarea.attr("style", "display: inline").focus(); }); if (inputField.val() == "") { inputField.addClass("default"); @@ -844,6 +845,22 @@ function getStatus() { $.each(data.sones, function(index, value) { updateSoneStatus(value.id, value.name, value.status, value.modified, value.locked, value.lastUpdatedUnknown ? null : value.lastUpdated); }); + /* search for removed notifications. */ + $("#sone #notification-area .notification").each(function() { + notificationId = $(this).attr("id"); + foundNotification = false; + $.each(data.notifications, function(index, value) { + if (value.id == notificationId) { + foundNotification = true; + return false; + } + }); + if (!foundNotification) { + $(this).slideUp("normal", function() { + $(this).remove(); + }); + } + }); /* process notifications. */ $.each(data.notifications, function(index, value) { oldNotification = $("#sone #notification-area .notification#" + value.id); @@ -858,11 +875,8 @@ function getStatus() { } else { $("#sone #notification-area").append(notification); notification.slideDown(); + setActivity(); } - setActivity(); - }); - $.each(data.removedNotifications, function(index, value) { - $("#sone #notification-area .notification#" + value.id).slideUp(); }); /* process new posts. */ $.each(data.newPosts, function(index, value) {