fix follow button behavior

This commit is contained in:
Simon Grim 2014-12-05 01:13:45 +06:00
parent 5e7a6f50df
commit d998de6299
4 changed files with 11 additions and 7 deletions

View File

@ -412,7 +412,7 @@
<li><a href="#"><span class="followers-count">&nbsp;</span><span class="label">Followers</span></a></li>
</ul>
</div>
<button class="followButton follow" href="#">Follow</button>
<button class="dinamicFollowButton" href="#">Follow</button>
<button class="direct-messages-with-user" href="#">Direct Messages</button>
</div>
<div class="who-follow"></div>

View File

@ -441,7 +441,7 @@
<li><a href="#"><span class="followers-count">&nbsp;</span><span class="label">Followers</span></a></li>
</ul>
</div>
<button class="followButton follow" href="#">Follow</button>
<button class="dinamicFollowButton" href="#">Follow</button>
<button class="direct-messages-with-user" href="#">Direct Messages</button>
<button class="mentions-from-user" href="#">Mentions</a>
</div>

View File

@ -135,9 +135,14 @@ function openProfileModalWithUsernameHandler(username)
//hed//add dinamic follow button in profile modal window
if(followingUsers.indexOf(username) != -1){
$('.profile-card button.followButton').first().removeClass('follow').addClass('profileUnfollow').text(polyglot.t('Unfollow')).on('click', function(){
$('.profile-card button.dinamicFollowButton').first().addClass('profileUnfollow').text(polyglot.t('Unfollow')).on('click', function(){
unfollow(username);
closeModal($(this));
// delay reload so dhtput may do it's job
window.setTimeout("location.reload();",500);
});
} else {
$('.profile-card button.dinamicFollowButton').first().addClass('follow').text(polyglot.t('Follow')).on('click', userClickFollow );
};
$(".tox-ctc").attr("title", polyglot.t("Copy to clipboard"));

View File

@ -710,6 +710,8 @@ function initUserSearch() {
$(".following-config-method-buttons .public-following").bind( "click", setFollowingMethod );
$(".following-config-method-buttons .public-following").click( function() {
closeModal($(this));
// delay reload so dhtput may do it's job
window.setTimeout("location.reload();",500);
});
}
@ -755,10 +757,7 @@ function setFollowingMethod(e) {
}
//console.log("start following @" +username +" by method "+method);
follow(username, method, function() {
// delay reload so dhtput may do it's job
window.setTimeout("location.reload();",500);
});
follow(username, method);
}