|
|
@ -385,10 +385,11 @@ function follow(user, publicFollow, cbFunc, cbArg) { |
|
|
|
function unfollow(user, cbFunc, cbArg) { |
|
|
|
function unfollow(user, cbFunc, cbArg) { |
|
|
|
//console.log('we are not following @'+user+' anymore');
|
|
|
|
//console.log('we are not following @'+user+' anymore');
|
|
|
|
var i = followingUsers.indexOf(user); |
|
|
|
var i = followingUsers.indexOf(user); |
|
|
|
if( i >= 0 ) { |
|
|
|
if (i >= 0) { |
|
|
|
followingUsers.splice(i,1); |
|
|
|
followingUsers.splice(i, 1); |
|
|
|
twisterFollowingO.update(user); |
|
|
|
twisterFollowingO.update(user); |
|
|
|
$(window).trigger("eventUnfollow", user) |
|
|
|
// FIXME also need to check list of pending posts to remove from there
|
|
|
|
|
|
|
|
$(window).trigger('eventUnfollow', user); |
|
|
|
} |
|
|
|
} |
|
|
|
delete _isFollowPublic[user]; |
|
|
|
delete _isFollowPublic[user]; |
|
|
|
saveFollowing(); |
|
|
|
saveFollowing(); |
|
|
@ -816,12 +817,12 @@ function initInterfaceFollowing() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$(window) |
|
|
|
$(window) |
|
|
|
.on("eventFollow", function(e, user) { |
|
|
|
.on('eventFollow', function(e, user) { |
|
|
|
$(".following-count").text(followingUsers.length-1); |
|
|
|
$('.mini-profile .following-count').text(followingUsers.length - 1); |
|
|
|
showFollowingUsers(); |
|
|
|
showFollowingUsers(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.on("eventUnfollow", function(e, user) { |
|
|
|
.on('eventUnfollow', function(e, user) { |
|
|
|
$(".following-count").text(followingUsers.length-1); |
|
|
|
$('.mini-profile .following-count').text(followingUsers.length - 1); |
|
|
|
showFollowingUsers(); |
|
|
|
showFollowingUsers(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|