diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index f18f1daba..a8bea348b 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -317,7 +317,6 @@ define([ teamId: obj.id }, waitFor(function (err) { if (err) { return void console.error(err); } - console.warn(obj.id); })); }); })); diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index a421ab38d..f3ef49bcc 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3822,7 +3822,7 @@ define([ data.sharedFolder = true; } - if (manager.isFile(el) && data.roHref) { // Only for pads! + if ((manager.isFile(el) && data.roHref) || manager.isSharedFolder(el)) { // Only for pads! sframeChan.query('Q_GET_PAD_METADATA', { channel: data.channel }, function (err, val) { diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 007a20cfe..49463c805 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -119,9 +119,14 @@ define([ // it's a cloned object (NOTE: href should never be edited directly) var findChannel = function (Env, channel, editable) { var ret = []; - Env.user.userObject.findChannels([channel]).forEach(function (id) { + Env.user.userObject.findChannels([channel], true).forEach(function (id) { + // Check in shared folders, then clone if needed + var data = Env.user.proxy[UserObject.SHARED_FOLDERS][id]; + if (data && !editable) { data = JSON.parse(JSON.stringify(data)); } + // If it's not a shared folder, check the pads + if (!data) { Env.user.userObject.getFileData(id, editable); } ret.push({ - data: Env.user.userObject.getFileData(id, editable), + data: data, userObject: Env.user.userObject }); }); diff --git a/www/common/userObject.js b/www/common/userObject.js index f5a1ff705..1c58ff831 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -615,10 +615,13 @@ define([ }; // Get drive ids of files from their channel ids - exp.findChannels = function (channels) { + exp.findChannels = function (channels, includeSharedFolders) { var allFilesList = files[FILES_DATA]; - return getFiles([FILES_DATA]).filter(function (k) { - var data = allFilesList[k]; + var sfList = files[SHARED_FOLDERS]; + var paths = [FILES_DATA]; + if (includeSharedFolders) { paths.push(SHARED_FOLDERS); } + return getFiles(paths).filter(function (k) { + var data = allFilesList[k] || sfList[k] || {}; return channels.indexOf(data.channel) !== -1; }); };