From 53afe6cb6898b415c3d8ccb556defa579c494381 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Mon, 2 Dec 2013 14:40:34 -0500 Subject: [PATCH] closes #591 --- public/src/forum/account.js | 27 +++++++++++++++++---------- public/templates/account.tpl | 7 +++++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/public/src/forum/account.js b/public/src/forum/account.js index 5056c2a26e..375ac4b9f1 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -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')); }); diff --git a/public/templates/account.tpl b/public/templates/account.tpl index 7327cca25f..eb14891b85 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -20,9 +20,12 @@ banned +
+ Chat +
- Follow - Unfollow + Follow + Unfollow