only display first letter of name if user has no avatar

pull/1/head
ansuz 7 years ago
parent 85003f7a23
commit e8298f165a

@ -1967,7 +1967,7 @@ define([
}; };
var $userAdmin = createDropdown(dropdownConfigUser); var $userAdmin = createDropdown(dropdownConfigUser);
var oldUrl; var oldUrl = '';
if (account && !config.static && store) { if (account && !config.static && store) {
var $avatar = $userAdmin.find('.cp-dropdown-button-title'); var $avatar = $userAdmin.find('.cp-dropdown-button-title');
var updateButton = function (newName) { var updateButton = function (newName) {
@ -1977,7 +1977,7 @@ define([
if (oldUrl === url) { return; } if (oldUrl === url) { return; }
oldUrl = url; oldUrl = url;
$avatar.html(''); $avatar.html('');
common.displayAvatar($avatar, url, newName, function ($img) { common.displayAvatar($avatar, url, newName || Messages.anonymous, function ($img) {
if ($img) { if ($img) {
$userAdmin.find('button').addClass('avatar'); $userAdmin.find('button').addClass('avatar');
} }

@ -374,7 +374,7 @@ define([
var $displayName = $userAdmin.find('.'+displayNameCls); var $displayName = $userAdmin.find('.'+displayNameCls);
var $avatar = $userAdmin.find('.cp-dropdown-button-title'); var $avatar = $userAdmin.find('.cp-dropdown-button-title');
var oldUrl; var oldUrl = '';
var updateButton = function () { var updateButton = function () {
var myData = metadataMgr.getUserData(); var myData = metadataMgr.getUserData();
if (!myData) { return; } if (!myData) { return; }
@ -383,7 +383,7 @@ define([
$displayName.text(newName || Messages.anonymous); $displayName.text(newName || Messages.anonymous);
if (accountName && oldUrl !== url) { if (accountName && oldUrl !== url) {
$avatar.html(''); $avatar.html('');
UI.displayAvatar(Common, $avatar, url, newName, function ($img) { UI.displayAvatar(Common, $avatar, url, newName || Messages.anonymous, function ($img) {
oldUrl = url; oldUrl = url;
if ($img) { if ($img) {
$userAdmin.find('button').addClass('cp-avatar'); $userAdmin.find('button').addClass('cp-avatar');

Loading…
Cancel
Save