From f0523a01530089368d1239927a906a222819dc54 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 10 Jul 2017 11:16:44 +0200 Subject: [PATCH] Avatar in the user admin menu --- www/common/cryptpad-common.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 901d33079..1b6912a57 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1582,8 +1582,7 @@ define([ //var $userbig = $('', {'class': 'big'}).append($displayedName.clone()); var $userButton = $('
').append($icon);//.append($userbig); if (account) { - - $userButton = $('
').append(accountName.slice(0,1).toUpperCase()); + $userButton = $('
');//.append(accountName.slice(0,1).toUpperCase()); } /*if (account && config.displayNameCls) { $userbig.append($('', {'class': 'account-name'}).text('(' + accountName + ')')); @@ -1600,6 +1599,13 @@ define([ }; var $userAdmin = createDropdown(dropdownConfigUser); + if (account) { + var $avatar = $userAdmin.find('.buttonTitle'); + var url = getStore() ? getStore().getProfile().avatar : undefined; + $avatar.html(''); + common.displayAvatar($avatar, url, accountName, function ($img) {}); + } + $userAdmin.find('a.logout').click(function () { common.logout(); window.location.href = '/';