Skip to content

Commit

Permalink
Only display buttons in Friend profile for available data, fixes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
edorcutt committed May 8, 2013
1 parent 584a648 commit 5f88de1
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion app/js/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,33 @@ $(document).ready(function() {
$('#btn-friend-sms').attr('href', 'sms:'+json.myProfilePhone);
$('#btn-friend-email').attr('href', 'mailto:'+json.myProfileEmail);

$('#modalSpinner').hide();
$('#btn-friend-message').show();

if (json.myProfilePhone) {
$('#friend-phone').show();
$('#btn-friend-tel').show();
$('#btn-friend-sms').show();
} else {
$('#friend-phone').hide();
$('#btn-friend-tel').hide();
$('#btn-friend-sms').hide();
}

if (json.myProfileEmail) {
$('#friend-email').show();
$('#btn-friend-email').show();
} else {
$('#friend-email').hide();
$('#btn-friend-email').hide();
}

} else {
$('#modalSpinner').hide();
$('#friend-name').text('Profile Unavailable');
$('#btn-friend-tel').hide();
$('#btn-friend-sms').hide();
$('#btn-friend-email').hide();
$('#btn-friend-message').hide();
}
}
)
Expand Down

0 comments on commit 5f88de1

Please sign in to comment.