Fix useradmin dropdown position

pull/1/head
yflory 7 years ago
parent 97d8d86395
commit e6188bfb63

@ -34,7 +34,8 @@ define([
// User admin menu // User admin menu
var $userMenu = $('#user-menu'); var $userMenu = $('#user-menu');
var userMenuCfg = { var userMenuCfg = {
$initBlock: $userMenu $initBlock: $userMenu,
'static': true
}; };
var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg); var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg);
$userAdmin.find('button').addClass('btn').addClass('btn-secondary'); $userAdmin.find('button').addClass('btn').addClass('btn-secondary');

@ -42,7 +42,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
font-size: 16px; font-size: 16px;
display: inline-flex; display: flex;
align-items: center; align-items: center;
&.clickable { &.clickable {
cursor: pointer; cursor: pointer;

@ -1657,7 +1657,7 @@ define([
//var $userbig = $('<span>', {'class': 'big'}).append($displayedName.clone()); //var $userbig = $('<span>', {'class': 'big'}).append($displayedName.clone());
var $userButton = $('<div>').append($icon);//.append($userbig); var $userButton = $('<div>').append($icon);//.append($userbig);
if (account) { if (account) {
$userButton = $('<div>');//.append(accountName.slice(0,1).toUpperCase()); $userButton = $('<div>').append(accountName);
} }
/*if (account && config.displayNameCls) { /*if (account && config.displayNameCls) {
$userbig.append($('<span>', {'class': 'account-name'}).text('(' + accountName + ')')); $userbig.append($('<span>', {'class': 'account-name'}).text('(' + accountName + ')'));
@ -1674,15 +1674,19 @@ define([
}; };
var $userAdmin = createDropdown(dropdownConfigUser); var $userAdmin = createDropdown(dropdownConfigUser);
if (account) { if (account && !config.static && store) {
var $avatar = $userAdmin.find('.buttonTitle'); var $avatar = $userAdmin.find('.buttonTitle');
var url = store ? store.getProfile().avatar : undefined; var updateButton = function (newName) {
$avatar.html(''); var url = store.getProfile().avatar;
common.displayAvatar($avatar, url, accountName, function ($img) { $avatar.html('');
if ($img) { common.displayAvatar($avatar, url, newName, function ($img) {
$userAdmin.find('button').addClass('avatar'); if ($img) {
} $userAdmin.find('button').addClass('avatar');
}); }
});
};
common.onDisplayNameChanged(updateButton);
updateButton(common.getDisplayName());
} }
$userAdmin.find('a.logout').click(function () { $userAdmin.find('a.logout').click(function () {

@ -500,7 +500,8 @@ define([
// User admin menu // User admin menu
var $userMenu = $('#user-menu'); var $userMenu = $('#user-menu');
var userMenuCfg = { var userMenuCfg = {
$initBlock: $userMenu $initBlock: $userMenu,
'static': true
}; };
var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg); var $userAdmin = Cryptpad.createUserAdminMenu(userMenuCfg);
$userAdmin.find('button').addClass('btn').addClass('btn-secondary'); $userAdmin.find('button').addClass('btn').addClass('btn-secondary');

@ -13,8 +13,6 @@ define([
], function ($, Cryptpad, Crypt, Merge) { ], function ($, Cryptpad, Crypt, Merge) {
var saveAs = window.saveAs; var saveAs = window.saveAs;
console.log("wut");
var USERNAME_KEY = 'cryptpad.username'; var USERNAME_KEY = 'cryptpad.username';
var APP = window.APP = { var APP = window.APP = {

Loading…
Cancel
Save