X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=05aab1d85f9202d4f36e6bf4d25614c320c3c57f;hp=383733a1e2b120165e2f6f132489c32635e8c2ff;hb=cc3c5cb776fa7913bdb45ce9602dc0e5cb5c8608;hpb=ea4f7914a1529e884f233e552edbe51f542a9b36 diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 383733a..05aab1d 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -823,9 +823,10 @@ function ajaxifyPost(postElement) { return false; }); (function(postElement) { + var soneId = $(".sone-id", postElement).text(); $(".sone-post-menu .follow", postElement).click(function() { var followElement = this; - ajaxGet("followSone.ajax", { "sone": $(".sone-id", postElement).text(), "formPassword": getFormPassword() }, function() { + ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() { $(followElement).addClass("hidden"); $(followElement).parent().find(".unfollow").removeClass("hidden"); }); @@ -833,7 +834,7 @@ function ajaxifyPost(postElement) { }); $(".sone-post-menu .unfollow", postElement).click(function() { var unfollowElement = this; - ajaxGet("unfollowSone.ajax", { "sone": $(".sone-id", postElement).text(), "formPassword": getFormPassword() }, function() { + ajaxGet("unfollowSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() { $(unfollowElement).addClass("hidden"); $(unfollowElement).parent().find(".follow").removeClass("hidden"); });