Browse Source

fix follow button behavior

master
Simon Grim 10 years ago
parent
commit
d998de6299
  1. 2
      following.html
  2. 2
      home.html
  3. 7
      js/interface_common.js
  4. 7
      js/twister_following.js

2
following.html

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

2
home.html

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

7
js/interface_common.js

@ -135,9 +135,14 @@ function openProfileModalWithUsernameHandler(username)
//hed//add dinamic follow button in profile modal window //hed//add dinamic follow button in profile modal window
if(followingUsers.indexOf(username) != -1){ 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); 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")); $(".tox-ctc").attr("title", polyglot.t("Copy to clipboard"));

7
js/twister_following.js

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

Loading…
Cancel
Save