- var soneId = $(".sone-menu-id:first", postElement).text();
- $(".sone-post-menu .follow", postElement).click(function() {
- var followElement = this;
- ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
- $(followElement).addClass("hidden");
- $(followElement).parent().find(".unfollow").removeClass("hidden");
- $("#sone .sone-menu").each(function() {
- if (getMenuSone(this) == soneId) {
- $(".follow", this).toggleClass("hidden", true);
- $(".unfollow", this).toggleClass("hidden", false);
- }
- });
- });
- return false;
- });
- $(".sone-post-menu .unfollow", postElement).click(function() {
- var unfollowElement = this;
- ajaxGet("unfollowSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
- $(unfollowElement).addClass("hidden");
- $(unfollowElement).parent().find(".follow").removeClass("hidden");
- $("#sone .sone-menu").each(function() {
- if (getMenuSone(this) == soneId) {
- $(".follow", this).toggleClass("hidden", false);
- $(".unfollow", this).toggleClass("hidden", true);
- }
- });
- });
- return false;
- });
+ const soneId = $(".sone-menu-id:first", postElement).text();
+ $(".sone-post-menu .follow", postElement).click(followSone(soneId));
+ $(".sone-post-menu .unfollow", postElement).click(unfollowSone(soneId));