Fix User menu and link to drive in anonymous shared folders
parent
d78a00b5e1
commit
9a6e6f6e15
|
@ -1513,8 +1513,9 @@ define([
|
|||
var displayNameCls = config.displayNameCls || 'cp-toolbar-user-name';
|
||||
var $displayedName = $('<span>', {'class': displayNameCls});
|
||||
|
||||
var accountName = metadataMgr.getPrivateData().accountName;
|
||||
var origin = metadataMgr.getPrivateData().origin;
|
||||
var priv = metadataMgr.getPrivateData();
|
||||
var accountName = priv.accountName;
|
||||
var origin = priv.origin;
|
||||
var padType = metadataMgr.getMetadata().type;
|
||||
|
||||
var $userName = $('<span>');
|
||||
|
@ -1538,7 +1539,7 @@ define([
|
|||
content: $userAdminContent.html()
|
||||
});
|
||||
}
|
||||
if (padType !== 'drive') {
|
||||
if (padType !== 'drive' || (!accountName && priv.newSharedFolder)) {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {
|
||||
|
|
|
@ -729,8 +729,12 @@ Messenger, MessengerUI, Messages) {
|
|||
var privateData = config.metadataMgr.getPrivateData();
|
||||
var origin = privateData.origin;
|
||||
var pathname = privateData.pathname;
|
||||
var href = inDrive.test(pathname) ? origin+'/index.html' : origin+'/drive/';
|
||||
var buttonTitle = inDrive.test(pathname) ? Messages.header_homeTitle : Messages.header_logoTitle;
|
||||
|
||||
var isAnonSF = privateData.newSharedFolder && !privateData.accountName;
|
||||
var toMain = inDrive.test(pathname) && !isAnonSF;
|
||||
|
||||
var href = toMain ? origin+'/index.html' : origin+'/drive/';
|
||||
var buttonTitle = toMain ? Messages.header_homeTitle : Messages.header_logoTitle;
|
||||
|
||||
var $aTag = $('<a>', {
|
||||
href: href,
|
||||
|
|
|
@ -385,15 +385,11 @@ define([
|
|||
e.stopPropagation();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// TOOLBAR
|
||||
|
||||
/* add a "change username" button */
|
||||
if (!APP.readOnly) {
|
||||
APP.$displayName.text(user.name || Messages.anonymous);
|
||||
} else {
|
||||
APP.$displayName.html('<span class="' + Toolbar.constants.readonly + '">' + Messages.readonly + '</span>');
|
||||
}
|
||||
|
||||
// FILE MANAGER
|
||||
|
@ -3559,7 +3555,7 @@ define([
|
|||
displayed: ['useradmin', 'pageTitle', 'newpad', 'limit'],
|
||||
pageTitle: pageTitle,
|
||||
metadataMgr: metadataMgr,
|
||||
readOnly: readOnly,
|
||||
readOnly: privateData.readOnly,
|
||||
sfCommon: common,
|
||||
$container: APP.$bar
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue