diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js
index 09242affb..dc4c8c1ab 100644
--- a/www/common/drive-ui.js
+++ b/www/common/drive-ui.js
@@ -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 = $('
', {'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);
diff --git a/www/drive/inner.html b/www/drive/inner.html
index abbb03414..b53b1a90e 100644
--- a/www/drive/inner.html
+++ b/www/drive/inner.html
@@ -17,7 +17,7 @@
diff --git a/www/drive/inner.js b/www/drive/inner.js
index 1dabf358a..e2415d2d0 100644
--- a/www/drive/inner.js
+++ b/www/drive/inner.js
@@ -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()) !== '{}') {
diff --git a/www/teams/inner.js b/www/teams/inner.js
index 54e1070a9..f571d5c84 100644
--- a/www/teams/inner.js
+++ b/www/teams/inner.js
@@ -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})
])
])