mirror of
https://github.com/humhub/humhub.git
synced 2025-02-22 18:22:43 +01:00
25 lines
786 B
JavaScript
25 lines
786 B
JavaScript
$(document).on('click', '.unfollowButton', function (event) {
|
|
var userId = $(this).data("userid");
|
|
$.ajax({
|
|
url: $(this).attr("href"),
|
|
type: "POST",
|
|
success: function () {
|
|
$(".unfollowButton[data-userid='" + userId + "']").hide();
|
|
$(".followButton[data-userid='" + userId + "']").show();
|
|
}
|
|
});
|
|
event.preventDefault();
|
|
});
|
|
|
|
$(document).on('click', '.followButton', function (event) {
|
|
var userId = $(this).data("userid");
|
|
$.ajax({
|
|
url: $(this).attr("href"),
|
|
type: "POST",
|
|
success: function () {
|
|
$(".unfollowButton[data-userid='" + userId + "']").show();
|
|
$(".followButton[data-userid='" + userId + "']").hide();
|
|
}
|
|
});
|
|
event.preventDefault();
|
|
}); |