mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-05 22:29:13 +02:00
closes #591
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user