mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
removed unfollow button + logic from following view
This commit is contained in:
@@ -4,37 +4,12 @@ define(['forum/accountheader'], function(header) {
|
|||||||
Following.init = function() {
|
Following.init = function() {
|
||||||
header.init();
|
header.init();
|
||||||
|
|
||||||
var yourid = templates.get('yourid'),
|
var followingCount = templates.get('followingCount');
|
||||||
theirid = templates.get('theirid'),
|
|
||||||
followingCount = templates.get('followingCount');
|
|
||||||
|
|
||||||
if (parseInt(followingCount, 10) === 0) {
|
if (parseInt(followingCount, 10) === 0) {
|
||||||
$('#no-following-notice').removeClass('hide');
|
$('#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();
|
app.addCommasToNumbers();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
<i class='icon-pencil'></i>
|
<i class='icon-pencil'></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a id="unfollow-btn" href="#" class="btn btn-default unfollow-btn" followingUid="{following.uid}" data-username="{following.username}">Unfollow</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- END following -->
|
<!-- END following -->
|
||||||
|
|||||||
Reference in New Issue
Block a user