summaryrefslogtreecommitdiffstats
path: root/settings/js/personal.js
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2014-03-21 20:23:31 +0100
committerkondou <kondou@ts.unde.re>2014-03-21 20:23:31 +0100
commitdda7129a243c7ebdbcdf9c2b5dbf167542402bc2 (patch)
treed03dff6783ebabb6273a19ed59a6b9b3731e923e /settings/js/personal.js
parent556c6eca2397eaa03c4503822d647c8b6cb5e70e (diff)
parent4be0b3f6cce540282c6745d6bf3d2a0fa4ac65b4 (diff)
downloadnextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.tar.gz
nextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.zip
Merge branch 'master' of https://github.com/owncloud/core into last_cron_log
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r--settings/js/personal.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 7a4257f1c97..f502037cfda 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -60,6 +60,8 @@ function updateAvatar (hidedefault) {
}
$displaydiv.css({'background-color': ''});
$displaydiv.avatar(OC.currentUser, 128, true);
+
+ $('#removeavatar').show();
}
function showAvatarCropper() {
@@ -256,6 +258,7 @@ $(document).ready(function(){
url: OC.generateUrl('/avatar/'),
success: function(msg) {
updateAvatar(true);
+ $('#removeavatar').hide();
}
});
});
@@ -278,6 +281,18 @@ $(document).ready(function(){
t('core', 'Strong password')
]
});
+
+ // does the user have a custom avatar? if he does hide #removeavatar
+ // needs to be this complicated because we can't check yet if an avatar has been loaded, because it's async
+ var url = OC.generateUrl(
+ '/avatar/{user}/{size}',
+ {user: OC.currentUser, size: 1}
+ ) + '?requesttoken=' + oc_requesttoken;
+ $.get(url, function(result) {
+ if (typeof(result) === 'object') {
+ $('#removeavatar').hide();
+ }
+ });
} );
OC.Encryption = {