X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;fp=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=8798aae1c8d1f2d3a2851b8f767dbeb017e2f596;hp=372a4989c92c9466511a19eb7c94c6b799fe60d1;hb=3335cbf7681220fcf95cff4895e025251211bf8e;hpb=ec8b354e2e78c17bd02649a0a618d258e28e306b diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 372a498..8798aae 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -685,34 +685,38 @@ function ajaxifySone(soneElement) { }); } -const followSone = function(soneId) { - const followElement = this; - ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() { - $(followElement).addClass("hidden"); - $(followElement).parent().find(".unfollow").removeClass("hidden"); - sone.find(".sone-menu").each(function() { - if (getMenuSone(this) === soneId) { - $(".follow", this).toggleClass("hidden", true); - $(".unfollow", this).toggleClass("hidden", false); - } +function followSone(soneId) { + return function() { + const followElement = this; + ajaxGet("followSone.ajax", {"sone": soneId, "formPassword": getFormPassword()}, function () { + $(followElement).addClass("hidden"); + $(followElement).parent().find(".unfollow").removeClass("hidden"); + sone.find(".sone-menu").each(function () { + if (getMenuSone(this) === soneId) { + $(".follow", this).toggleClass("hidden", true); + $(".unfollow", this).toggleClass("hidden", false); + } + }); }); - }); - return false; -}; + return false; + } +} -const unfollowSone = function (soneId) { - const unfollowElement = this; - ajaxGet("unfollowSone.ajax", {"sone": soneId, "formPassword": getFormPassword()}, function () { - $(unfollowElement).addClass("hidden"); - $(unfollowElement).parent().find(".follow").removeClass("hidden"); - sone.find(".sone-menu").each(function () { - if (getMenuSone(this) === soneId) { - $(".follow", this).toggleClass("hidden", false); - $(".unfollow", this).toggleClass("hidden", true); - } +function unfollowSone(soneId) { + return function() { + const unfollowElement = this; + ajaxGet("unfollowSone.ajax", {"sone": soneId, "formPassword": getFormPassword()}, function () { + $(unfollowElement).addClass("hidden"); + $(unfollowElement).parent().find(".follow").removeClass("hidden"); + sone.find(".sone-menu").each(function () { + if (getMenuSone(this) === soneId) { + $(".follow", this).toggleClass("hidden", false); + $(".unfollow", this).toggleClass("hidden", true); + } + }); }); - }); - return false; + return false; + } }; /**