-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);
+ }
+ });