summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-05-16 13:47:35 +0800
committerCheng-Han, Wu2016-05-16 13:47:35 +0800
commitc8560ec5fbd346cd6d73375af3f69a31463a10f5 (patch)
treebe0eb7356a19538d7d73ead098d74baeafe2066d /public
parent6b521b99d406b5b32720407d70726c7462ba646f (diff)
Fix to handle if user avatar photo is null
Diffstat (limited to 'public')
-rw-r--r--public/js/cover.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/public/js/cover.js b/public/js/cover.js
index 1b6c4221..d5ba2b3c 100644
--- a/public/js/cover.js
+++ b/public/js/cover.js
@@ -32,7 +32,8 @@ function pageInit() {
$('.ui-signin').hide();
$('.ui-or').hide();
$('.ui-welcome').show();
- $('.ui-avatar').prop('src', data.photo);
+ if (data.photo) $('.ui-avatar').prop('src', data.photo).show();
+ else $('.ui-avatar').prop('src', '').hide();
$('.ui-name').html(data.name);
$('.ui-signout').show();
$(".ui-history").click();
@@ -42,7 +43,7 @@ function pageInit() {
$('.ui-signin').slideDown();
$('.ui-or').slideDown();
$('.ui-welcome').hide();
- $('.ui-avatar').prop('src', '');
+ $('.ui-avatar').prop('src', '').hide();
$('.ui-name').html('');
$('.ui-signout').hide();
parseStorageToHistory(historyList, parseHistoryCallback);