X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=f6327e450a5e0e5c72a4d941473ec937acb64099;hb=f7bb19a511caebdf7fb892d4a0c5d350be08472c;hp=b5a7a2a67a6b8c8b91b72c8577d2ebd302420a13;hpb=0a9c148df4c376753b93a54b694d693120da7a24;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index b5a7a2a..f6327e4 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -291,7 +291,7 @@ function getSoneElement(element) { * @return The Sone ID */ function getMenuSone(element) { - return $(element).closest(".sone-menu").find(".sone-id").text(); + return $(element).closest(".sone-menu").find(".sone-menu-id").text(); } /** @@ -858,13 +858,14 @@ function ajaxifyPost(postElement) { /* show Sone menu when hovering over the avatar. */ $(postElement).find(".post-avatar").mouseover(function() { + $(".sone-menu:visible").fadeOut(); $(".sone-post-menu", postElement).mouseleave(function() { $(this).fadeOut(); }).fadeIn(); return false; }); (function(postElement) { - var soneId = $(".sone-id", postElement).text(); + var soneId = $(".sone-menu-id", postElement).text(); $(".sone-post-menu .follow", postElement).click(function() { var followElement = this; ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() { @@ -987,13 +988,14 @@ function ajaxifyReply(replyElement) { /* show Sone menu when hovering over the avatar. */ $(replyElement).find(".reply-avatar").mouseover(function() { + $(".sone-menu:visible").fadeOut(); $(".sone-reply-menu", replyElement).mouseleave(function() { $(this).fadeOut(); }).fadeIn(); return false; }); (function(replyElement) { - var soneId = $(".sone-id", replyElement).text(); + var soneId = $(".sone-menu-id", replyElement).text(); $(".sone-menu .follow", replyElement).click(function() { var followElement = this; ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() { @@ -1139,7 +1141,7 @@ function checkForRemovedPosts(oldNotification, newNotification) { * The new notification element */ function checkForRemovedReplies(oldNotification, newNotification) { - if (getNotificationId(oldNotification) != "new-replies-notification") { + if (getNotificationId(oldNotification) != "new-reply-notification") { return; } oldIds = getElementIds(oldNotification, ".reply-id"); @@ -1183,7 +1185,7 @@ function getStatus() { postId = $(this).text(); markPostAsKnown(getPost(postId), true); }); - } else if (notificationId == "new-replies-notification") { + } else if (notificationId == "new-reply-notification") { $(".reply-id", this).each(function(index, element) { replyId = $(this).text(); markReplyAsKnown(getReply(replyId), true);