summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-09-20 09:05:09 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-09-20 21:39:12 +0200
commit72bf1df7f7acc712d119465d6616e5bea15af57b (patch)
treebbe7aafbb380d8c37333593d0eb9ab62398d9413 /settings/js
parent8358c63f53ac2cce177aa3cacee6fa3db7a4eaee (diff)
downloadnextcloud-server-72bf1df7f7acc712d119465d6616e5bea15af57b.tar.gz
nextcloud-server-72bf1df7f7acc712d119465d6616e5bea15af57b.zip
Set the displayname for the avatar in the personal info
Otherwise the color used is different Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/settings/personalInfo.js16
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;