Hide drive info box when in read-only mode + update UI

pull/1/head
yflory 5 years ago
parent 80f5ebc0cc
commit 2e182788ec

@ -534,7 +534,7 @@ define([
APP.hideDuplicateOwned = Util.find(priv, ['settings', 'drive', 'hideDuplicate']);
APP.closed = false;
var $readOnly = $('#cp-app-drive-edition-state');
var $readOnly = $(h('div#cp-app-drive-edition-state.cp-app-drive-content-info-box', Messages.readonly));
var updateObject = driveConfig.updateObject;
var updateSharedFolders = driveConfig.updateSharedFolders;
@ -2169,6 +2169,7 @@ define([
var createInfoBox = function (path) {
if (APP.readOnly || $content.data('readOnlyFolder')) { return; }
var $box = $('<div>', {'class': 'cp-app-drive-content-info-box'});
var msg;
switch (path[0]) {
@ -3362,13 +3363,11 @@ define([
var readOnlyFolder = false;
if (APP.readOnly) {
// Read-only drive (team?)
$readOnly.show();
$content.prepend($readOnly.clone());
} else if (folders[sfId] && folders[sfId].readOnly) {
// If readonly shared folder...
$readOnly.show();
$content.prepend($readOnly.clone());
readOnlyFolder = true;
} else {
$readOnly.hide();
}
$content.data('readOnlyFolder', readOnlyFolder);

@ -17,7 +17,7 @@
<div id="cp-app-drive-content-container">
<div id="cp-app-drive-toolbar"></div>
<div id="cp-app-drive-connection-state" style="display: none"></div>
<div id="cp-app-drive-edition-state" style="display: none"></div>
<div id="cp-app-drive-edition-state" class="cp-app-drive-content-info-box" style="display: none"></div>
<div id="cp-app-drive-content" tabindex="2"></div>
</div>
</div>

@ -77,6 +77,7 @@ define([
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey);
}));
});
// Remove from memory folders that have been deleted from the drive remotely
oldIds.forEach(function (fId) {
if (!drive.sharedFolders[fId]) {
delete folders[fId];
@ -134,7 +135,6 @@ define([
SFCommon.create(waitFor(function (c) { common = c; }));
}).nThen(function (waitFor) {
$('#cp-app-drive-connection-state').text(Messages.disconnected);
$('#cp-app-drive-edition-state').text(Messages.readonly);
var privReady = Util.once(waitFor());
var metadataMgr = common.getMetadataMgr();
if (JSON.stringify(metadataMgr.getPrivateData()) !== '{}') {

@ -485,7 +485,6 @@ define([
h('div#cp-app-drive-content-container', [
h('div#cp-app-drive-toolbar'),
h('div#cp-app-drive-connection-state', {style: "display: none;"}, Messages.disconnected),
h('div#cp-app-drive-edition-state', {style: "display: none;"}, Messages.readonly),
h('div#cp-app-drive-content', {tabindex:2})
])
])

Loading…
Cancel
Save