Skip to content
Snippets Groups Projects
Commit 3c03ff5b authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #7340 from owncloud/hide_remove_image_avatar

Hide remove image, if there's no custom avatar
parents 9fa9c791 8fafee31
Branches
No related tags found
No related merge requests found
......@@ -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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment