Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2014-03-13 16:20:00 +0400
committerMorris Jobke <morris.jobke@gmail.com>2014-03-13 16:20:00 +0400
commit3c03ff5bb554b0b738864f857d18e35762f13d18 (patch)
treee183139ce90546b1b8161a73d0c9b84e922b25e8 /settings
parent9fa9c791eb09013e38ebe0d7739ab862eae611ce (diff)
parent8fafee31efd9cb8126cc82017b6bb2d614d9b977 (diff)
Merge pull request #7340 from owncloud/hide_remove_image_avatar
Hide remove image, if there's no custom avatar
Diffstat (limited to 'settings')
-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 = {