diff options
author | Joas Schilling <coding@schilljs.com> | 2017-09-20 23:04:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-20 23:04:37 +0200 |
commit | f0f396b527532a0a4fbe00542936a2717acd8712 (patch) | |
tree | bbe7aafbb380d8c37333593d0eb9ab62398d9413 | |
parent | 8358c63f53ac2cce177aa3cacee6fa3db7a4eaee (diff) | |
parent | 72bf1df7f7acc712d119465d6616e5bea15af57b (diff) | |
download | nextcloud-server-f0f396b527532a0a4fbe00542936a2717acd8712.tar.gz nextcloud-server-f0f396b527532a0a4fbe00542936a2717acd8712.zip |
Merge pull request #6579 from nextcloud/settings-displayname-avatar
Set the displayname for the avatar in the personal info
-rw-r--r-- | settings/js/settings/personalInfo.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/settings/js/settings/personalInfo.js b/settings/js/settings/personalInfo.js index 89b37d291c5..10c92ece8f4 100644 --- a/settings/js/settings/personalInfo.js +++ b/settings/js/settings/personalInfo.js @@ -41,8 +41,9 @@ jQuery.fn.keyUpDelayedOrEnter = function (callback, allowEmptyValue) { }; function updateAvatar (hidedefault) { - var $headerdiv = $('#header .avatardiv'); - var $displaydiv = $('#displayavatar .avatardiv'); + var $headerdiv = $('#header .avatardiv'), + $displaydiv = $('#displayavatar .avatardiv'), + user = OC.getCurrentUser(); //Bump avatar avatarversion oc_userconfig.avatar.version = -(Math.floor(Math.random() * 1000)); @@ -52,11 +53,11 @@ function updateAvatar (hidedefault) { $('#header .avatardiv').removeClass('avatardiv-shown'); } else { $headerdiv.css({'background-color': ''}); - $headerdiv.avatar(OC.currentUser, 32, true); + $headerdiv.avatar(user.uid, 32, true, false, undefined, user.displayName); $('#header .avatardiv').addClass('avatardiv-shown'); } $displaydiv.css({'background-color': ''}); - $displaydiv.avatar(OC.currentUser, 145, true, null, function() { + $displaydiv.avatar(user.uid, 145, true, null, function() { $displaydiv.removeClass('loading'); $('#displayavatar img').show(); if($('#displayavatar img').length === 0) { @@ -64,7 +65,7 @@ function updateAvatar (hidedefault) { } else { $('#removeavatar').removeClass('hidden').addClass('inlineblock'); } - }); + }, user.displayName); } function showAvatarCropper () { @@ -388,13 +389,14 @@ $(document).ready(function () { }); // Load the big avatar - $('#avatarform .avatardiv').avatar(OC.currentUser, 145, true, null, function() { + var user = OC.getCurrentUser(); + $('#avatarform .avatardiv').avatar(user.uid, 145, true, null, function() { if($('#displayavatar img').length === 0) { $('#removeavatar').removeClass('inlineblock').addClass('hidden'); } else { $('#removeavatar').removeClass('hidden').addClass('inlineblock'); } - }); + }, user.displayName); }); OC.Settings.updateAvatar = updateAvatar; |