fixed unfollow button

v1.18.x
Baris Usakli 12 years ago
parent d1041bedf4
commit 09c80b8289

@ -59,7 +59,7 @@
</div> </div>
</div> </div>
<div id="user-actions" class="container"> <div id="user-actions" class="container">
<a id="add-friend-btn" href="#" class="btn">Add Friend</a> <a id="add-friend-btn" href="#" class="btn">Follow</a>
</div> </div>
<br/> <br/>
<div id="user-action-alert" class="alert alert-success hide"></div> <div id="user-action-alert" class="alert alert-success hide"></div>
@ -104,16 +104,14 @@ var theirid = '{theirid}';
addFriendBtn.on('click', function() { addFriendBtn.on('click', function() {
$.post('/users/addfriend', {uid: theirid}, $.post('/users/addfriend', {uid: theirid},
function(data) { function(data) {
addFriendBtn.remove();
$('#user-action-alert').html('Friend Added!').show(); $('#user-action-alert').html('Friend Added!').show();
} }
); );
return false; return false;
}); });
}); });
}()); }());
</script> </script>

@ -32,7 +32,7 @@
<span class='postcount'>{friends.postcount}</span> <span class='postcount'>{friends.postcount}</span>
<i class='icon-pencil'></i> <i class='icon-pencil'></i>
</div> </div>
<a id="remove-friend-btn" href="#" class="btn remove-friend-btn" friendid="{friends.uid}">Unfriend</a> <a id="remove-friend-btn" href="#" class="btn remove-friend-btn" friendid="{friends.uid}">Unfollow</a>
</div> </div>
<!-- END friends --> <!-- END friends -->
@ -72,7 +72,7 @@ var friendCount = '{friendCount}';
$.post('/users/removefriend', {uid: friendid}, $.post('/users/removefriend', {uid: friendid},
function(data) { function(data) {
button.parent().remove(); removeBtn.parent().remove();
} }
); );
return false; return false;

Loading…
Cancel
Save