removed unfollow button + logic from following view

This commit is contained in:
psychobunny
2013-11-05 15:10:32 -05:00
parent 3b3e8348e4
commit b5c22c7ff7
2 changed files with 1 additions and 27 deletions

View File

@@ -4,37 +4,12 @@ define(['forum/accountheader'], function(header) {
Following.init = function() {
header.init();
var yourid = templates.get('yourid'),
theirid = templates.get('theirid'),
followingCount = templates.get('followingCount');
var followingCount = templates.get('followingCount');
if (parseInt(followingCount, 10) === 0) {
$('#no-following-notice').removeClass('hide');
}
if (yourid !== theirid) {
$('.unfollow-btn').hide();
} else {
$('.unfollow-btn').on('click', function() {
var unfollowBtn = $(this);
var followingUid = $(this).attr('followingUid');
socket.emit('api:user.unfollow', {
uid: followingUid
}, function(success) {
var username = unfollowBtn.attr('data-username');
if (success) {
unfollowBtn.parent().remove();
app.alertSuccess('You are no longer following ' + username + '!');
} else {
app.alertError('There was an error unfollowing ' + username + '!');
}
});
return false;
});
}
app.addCommasToNumbers();
};