Add icons in the user menu

pull/1/head
yflory 7 years ago
parent d0c38d31e4
commit d4dfbddaa6

@ -55,9 +55,23 @@
user-select: none; user-select: none;
float: none; float: none;
text-align: left; text-align: left;
font: @dropdown_font;
line-height: 1em; line-height: 1em;
align-items: center;
&:not(.fa) {
font: @dropdown_font;
}
&.fa {
font-size: 18px;
&::before {
width: 40px;
margin-left: -10px;
text-align: center;
}
* {
font: @dropdown_font;
}
}
.fa { .fa {
width: 20px; width: 20px;

@ -1422,50 +1422,51 @@ define([
tag: 'a', tag: 'a',
attributes: { attributes: {
'target': '_blank', 'target': '_blank',
'href': origin+'/drive/' 'href': origin+'/drive/',
'class': 'fa fa-hdd-o'
}, },
content: Messages.login_accessDrive content: h('span', Messages.login_accessDrive)
}); });
} }
// Add the change display name button if not in read only mode // Add the change display name button if not in read only mode
if (config.changeNameButtonCls && config.displayChangeName && !AppConfig.disableProfile) { if (config.changeNameButtonCls && config.displayChangeName && !AppConfig.disableProfile) {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': config.changeNameButtonCls}, attributes: {'class': config.changeNameButtonCls + ' fa fa-user'},
content: Messages.user_rename content: h('span', Messages.user_rename)
}); });
} }
if (accountName && !AppConfig.disableProfile) { if (accountName && !AppConfig.disableProfile) {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-toolbar-menu-profile'}, attributes: {'class': 'cp-toolbar-menu-profile fa fa-user-circle'},
content: Messages.profileButton content: h('span', Messages.profileButton)
}); });
} }
if (padType !== 'settings') { if (padType !== 'settings') {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-toolbar-menu-settings'}, attributes: {'class': 'cp-toolbar-menu-settings fa fa-cog'},
content: Messages.settingsButton content: h('span', Messages.settingsButton)
}); });
} }
// Add login or logout button depending on the current status // Add login or logout button depending on the current status
if (accountName) { if (accountName) {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-toolbar-menu-logout'}, attributes: {'class': 'cp-toolbar-menu-logout fa fa-sign-out'},
content: Messages.logoutButton content: h('span', Messages.logoutButton)
}); });
} else { } else {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-toolbar-menu-login'}, attributes: {'class': 'cp-toolbar-menu-login fa fa-sign-in'},
content: Messages.login_login content: h('span', Messages.login_login)
}); });
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-toolbar-menu-register'}, attributes: {'class': 'cp-toolbar-menu-register fa fa-user-plus'},
content: Messages.login_register content: h('span', Messages.login_register)
}); });
} }
var $icon = $('<span>', {'class': 'fa fa-user-secret'}); var $icon = $('<span>', {'class': 'fa fa-user-secret'});
@ -1521,9 +1522,8 @@ define([
UIElements.displayAvatar(Common, $avatar, url, UIElements.displayAvatar(Common, $avatar, url,
newName || Messages.anonymous, function ($img) { newName || Messages.anonymous, function ($img) {
oldUrl = url; oldUrl = url;
if ($img) { $userAdmin.find('> button').removeClass('cp-avatar');
$userAdmin.find('> button').addClass('cp-avatar'); if ($img) { $userAdmin.find('> button').addClass('cp-avatar'); }
}
loadingAvatar = false; loadingAvatar = false;
}); });
return; return;

Loading…
Cancel
Save