v1.18.x
Baris Usakli 11 years ago
parent 391b8098a3
commit 53afe6cb68

@ -17,18 +17,21 @@ define(['forum/accountheader'], function(header) {
var followBtn = $('#follow-btn');
var unfollowBtn = $('#unfollow-btn');
var chatBtn = $('#chat-btn');
if (yourid !== theirid && yourid !== "0") {
if (isFollowing) {
followBtn.hide();
unfollowBtn.show();
followBtn.addClass('hide');
unfollowBtn.removeClass('hide');
} else {
followBtn.show();
unfollowBtn.hide();
followBtn.removeClass('hide');
unfollowBtn.addClass('hide');
}
chatBtn.removeClass('hide');
} else {
followBtn.hide();
unfollowBtn.hide();
followBtn.addClass('hide');
unfollowBtn.addClass('hide');
chatBtn.addClass('hide');
}
followBtn.on('click', function() {
@ -36,8 +39,8 @@ define(['forum/accountheader'], function(header) {
uid: theirid
}, function(success) {
if (success) {
followBtn.hide();
unfollowBtn.show();
followBtn.addClasss('hide');
unfollowBtn.removeClass('hide');
app.alertSuccess('You are now following ' + username + '!');
} else {
app.alertError('There was an error following' + username + '!');
@ -51,8 +54,8 @@ define(['forum/accountheader'], function(header) {
uid: theirid
}, function(success) {
if (success) {
followBtn.show();
unfollowBtn.hide();
followBtn.removeClass('hide');
unfollowBtn.addClass('hide');
app.alertSuccess('You are no longer following ' + username + '!');
} else {
app.alertError('There was an error unfollowing ' + username + '!');
@ -61,6 +64,10 @@ define(['forum/accountheader'], function(header) {
return false;
});
chatBtn.on('click', function() {
app.openChat(username, theirid);
});
$('.user-recent-posts .topic-row').on('click', function() {
ajaxify.go($(this).attr('topic-url'));
});

@ -20,9 +20,12 @@
<span class="label label-danger">banned</span>
</div>
<!-- ENDIF banned -->
<div>
<a id="chat-btn" href="#" class="btn btn-default hide">Chat</a>
</div>
<div id="user-actions">
<a id="follow-btn" href="#" class="btn btn-default">Follow</a>
<a id="unfollow-btn" href="#" class="btn btn-default">Unfollow</a>
<a id="follow-btn" href="#" class="btn btn-default hide">Follow</a>
<a id="unfollow-btn" href="#" class="btn btn-default hide">Unfollow</a>
</div>
</div>

Loading…
Cancel
Save