diff --git a/customize.dist/header.js b/customize.dist/header.js index 7a2ac9295..ecef95f56 100644 --- a/customize.dist/header.js +++ b/customize.dist/header.js @@ -34,7 +34,8 @@ define([ // User admin menu var $userMenu = $('#user-menu'); var userMenuCfg = { - $initBlock: $userMenu + $initBlock: $userMenu, + 'static': true }; var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg); $userAdmin.find('button').addClass('btn').addClass('btn-secondary'); diff --git a/customize.dist/src/less/mixins.less b/customize.dist/src/less/mixins.less index e704a346d..e81f33f76 100644 --- a/customize.dist/src/less/mixins.less +++ b/customize.dist/src/less/mixins.less @@ -42,7 +42,7 @@ overflow: hidden; text-overflow: ellipsis; font-size: 16px; - display: inline-flex; + display: flex; align-items: center; &.clickable { cursor: pointer; diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 009443bdd..3960efa71 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1657,7 +1657,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); } /*if (account && config.displayNameCls) { $userbig.append($('', {'class': 'account-name'}).text('(' + accountName + ')')); @@ -1674,15 +1674,19 @@ define([ }; var $userAdmin = createDropdown(dropdownConfigUser); - if (account) { + if (account && !config.static && store) { var $avatar = $userAdmin.find('.buttonTitle'); - var url = store ? store.getProfile().avatar : undefined; - $avatar.html(''); - common.displayAvatar($avatar, url, accountName, function ($img) { - if ($img) { - $userAdmin.find('button').addClass('avatar'); - } - }); + var updateButton = function (newName) { + var url = store.getProfile().avatar; + $avatar.html(''); + common.displayAvatar($avatar, url, newName, function ($img) { + if ($img) { + $userAdmin.find('button').addClass('avatar'); + } + }); + }; + common.onDisplayNameChanged(updateButton); + updateButton(common.getDisplayName()); } $userAdmin.find('a.logout').click(function () { diff --git a/www/profile/main.js b/www/profile/main.js index 1f08607e7..7f4d13afe 100644 --- a/www/profile/main.js +++ b/www/profile/main.js @@ -500,7 +500,8 @@ define([ // User admin menu var $userMenu = $('#user-menu'); var userMenuCfg = { - $initBlock: $userMenu + $initBlock: $userMenu, + 'static': true }; var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg); $userAdmin.find('button').addClass('btn').addClass('btn-secondary'); diff --git a/www/settings/main.js b/www/settings/main.js index 6331ee38b..2f16aff70 100644 --- a/www/settings/main.js +++ b/www/settings/main.js @@ -13,8 +13,6 @@ define([ ], function ($, Cryptpad, Crypt, Merge) { var saveAs = window.saveAs; - console.log("wut"); - var USERNAME_KEY = 'cryptpad.username'; var APP = window.APP = {