diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-12-16 16:44:47 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-12-19 18:49:26 +0100 |
commit | 4c3eb80a9102ceaf08d5143eaba8877a8a43e57d (patch) | |
tree | 0c9aed8fbd785bc585cfef63c66105b0578238db /settings | |
parent | d497f79625a35330f8a07d9d6913281fa2d0deac (diff) | |
download | nextcloud-server-4c3eb80a9102ceaf08d5143eaba8877a8a43e57d.tar.gz nextcloud-server-4c3eb80a9102ceaf08d5143eaba8877a8a43e57d.zip |
Hide delete button if the avatar is a generated one
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/settings/personalInfo.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/settings/js/settings/personalInfo.js b/settings/js/settings/personalInfo.js index c95b87b01da..0a39e607762 100644 --- a/settings/js/settings/personalInfo.js +++ b/settings/js/settings/personalInfo.js @@ -60,7 +60,7 @@ function updateAvatar (hidedefault) { $displaydiv.avatar(user.uid, 145, true, null, function() { $displaydiv.removeClass('loading'); $('#displayavatar img').show(); - if($('#displayavatar img').length === 0) { + if($('#displayavatar img').length === 0 || oc_userconfig.avatar.generated) { $('#removeavatar').removeClass('inlineblock').addClass('hidden'); } else { $('#removeavatar').removeClass('hidden').addClass('inlineblock'); @@ -129,6 +129,7 @@ function avatarResponseHandler (data) { $warning.hide(); if (data.status === "success") { $('#displayavatar .avatardiv').removeClass('icon-loading'); + oc_userconfig.avatar.generated = false; updateAvatar(); } else if (data.data === "notsquare") { showAvatarCropper(); @@ -368,6 +369,7 @@ $(document).ready(function () { type: 'DELETE', url: OC.generateUrl('/avatar/'), success: function () { + oc_userconfig.avatar.generated = true; updateAvatar(true); } }); @@ -398,7 +400,7 @@ $(document).ready(function () { // Load the big avatar var user = OC.getCurrentUser(); $('#avatarform .avatardiv').avatar(user.uid, 145, true, null, function() { - if($('#displayavatar img').length === 0) { + if($('#displayavatar img').length === 0 || oc_userconfig.avatar.generated) { $('#removeavatar').removeClass('inlineblock').addClass('hidden'); } else { $('#removeavatar').removeClass('hidden').addClass('inlineblock'); |