remove unused code

v1.18.x
pichalite 9 years ago
parent d133ff74bd
commit e6e4b5784d

@ -9,21 +9,16 @@ define('forum/account/profile', [
'components' 'components'
], function(header, infinitescroll, translator) { ], function(header, infinitescroll, translator) {
var Account = {}, var Account = {},
yourid, theirid;
theirid,
isFollowing;
Account.init = function() { Account.init = function() {
header.init(); header.init();
yourid = ajaxify.data.yourid;
theirid = ajaxify.data.theirid; theirid = ajaxify.data.theirid;
isFollowing = ajaxify.data.isFollowing;
app.enterRoom('user/' + theirid); app.enterRoom('user/' + theirid);
processPage(); processPage();
updateButtons();
socket.removeListener('event:user_status_change', onUserStatusChange); socket.removeListener('event:user_status_change', onUserStatusChange);
socket.on('event:user_status_change', onUserStatusChange); socket.on('event:user_status_change', onUserStatusChange);
@ -35,13 +30,6 @@ define('forum/account/profile', [
$('[component="posts"] img:not(.not-responsive), [component="aboutme"] img:not(.not-responsive)').addClass('img-responsive'); $('[component="posts"] img:not(.not-responsive), [component="aboutme"] img:not(.not-responsive)').addClass('img-responsive');
} }
function updateButtons() {
var isSelfOrNotLoggedIn = yourid === theirid || parseInt(yourid, 10) === 0;
$('#follow-btn').toggleClass('hide', isFollowing || isSelfOrNotLoggedIn);
$('#unfollow-btn').toggleClass('hide', !isFollowing || isSelfOrNotLoggedIn);
$('#chat-btn').toggleClass('hide', isSelfOrNotLoggedIn);
}
function onUserStatusChange(data) { function onUserStatusChange(data) {
if (parseInt(ajaxify.data.theirid, 10) !== parseInt(data.uid, 10)) { if (parseInt(ajaxify.data.theirid, 10) !== parseInt(data.uid, 10)) {
return; return;

Loading…
Cancel
Save