remove some dead toolbar code

pull/1/head
ansuz 3 years ago
parent e772b8370a
commit 6a4ef02c41

@ -53,7 +53,6 @@ MessengerUI, Messages, Pages) {
var USERADMIN_CLS = Bar.constants.user = 'cp-toolbar-user-dropdown'; var USERADMIN_CLS = Bar.constants.user = 'cp-toolbar-user-dropdown';
var USERNAME_CLS = Bar.constants.username = 'cp-toolbar-user-name'; var USERNAME_CLS = Bar.constants.username = 'cp-toolbar-user-name';
/*var READONLY_CLS = */Bar.constants.readonly = 'cp-toolbar-readonly'; /*var READONLY_CLS = */Bar.constants.readonly = 'cp-toolbar-readonly';
var USERBUTTON_CLS = Bar.constants.changeUsername = "cp-toolbar-user-rename";
// Create the toolbar element // Create the toolbar element
@ -1029,36 +1028,13 @@ MessengerUI, Messages, Pages) {
var userMenuCfg = { var userMenuCfg = {
$initBlock: $userAdmin, $initBlock: $userAdmin,
}; };
if (!config.hideDisplayName) {
$.extend(true, userMenuCfg, {
displayNameCls: USERNAME_CLS,
changeNameButtonCls: USERBUTTON_CLS,
});
}
if (config.readOnly !== 1) { if (config.readOnly !== 1) {
userMenuCfg.displayName = 1; userMenuCfg.displayName = 1;
userMenuCfg.displayChangeName = 1; userMenuCfg.displayChangeName = 1;
} }
/*if (config.displayed.indexOf('userlist') !== -1) {
userMenuCfg.displayChangeName = 0;
}*/
Common.createUserAdminMenu(userMenuCfg); Common.createUserAdminMenu(userMenuCfg);
$userAdmin.find('> button').attr('title', Messages.userAccountButton); $userAdmin.find('> button').attr('title', Messages.userAccountButton);
var $userButton = toolbar.$userNameButton = $userAdmin.find('a.' + USERBUTTON_CLS);
$userButton.click(function (e) {
e.preventDefault();
e.stopPropagation();
var myData = metadataMgr.getUserData();
var lastName = myData.name;
UI.prompt(Messages.changeNamePrompt, lastName || '', function (newName) {
if (newName === null && typeof(lastName) === "string") { return; }
if (newName === null) { newName = ''; }
else { Feedback.send('NAME_CHANGED'); }
setDisplayName(newName);
});
});
return $userAdmin; return $userAdmin;
}; };

@ -62,7 +62,6 @@ define([
} }
var configTb = { var configTb = {
displayed: displayed, displayed: displayed,
//hideDisplayName: true,
$container: $bar, $container: $bar,
metadataMgr: metadataMgr, metadataMgr: metadataMgr,
sfCommon: common, sfCommon: common,

Loading…
Cancel
Save