Merge branch 'staging' into exportSheet

pull/1/head
yflory 3 years ago
commit c8384f42c9

@ -286,7 +286,9 @@
display: none; display: none;
} }
input { input {
width: ~"calc(100% - 30px)"; //width: ~"calc(100% - 30px)";
flex: 1;
min-width: 0;
padding: 0 10px; padding: 0 10px;
border: 0; border: 0;
height: auto; height: auto;
@ -298,8 +300,9 @@
.leftside-menu-category_main(); .leftside-menu-category_main();
width: ~"calc(100% + 5px)"; width: ~"calc(100% + 5px)";
margin: 0; margin: 0;
margin-bottom: -6px; //margin-bottom: -6px;
display: inline-block; display: flex;
align-items: center;
cursor: pointer; cursor: pointer;
margin-left: -5px; margin-left: -5px;
padding-left: 5px; padding-left: 5px;
@ -309,6 +312,12 @@
width: 25px; width: 25px;
margin-right: 0px; margin-right: 0px;
} }
.cp-app-drive-element {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
} }
} }
} }

@ -643,7 +643,7 @@ define([
// DRIVE // DRIVE
var currentPath = APP.currentPath = LS.getLastOpenedFolder(); var currentPath = APP.currentPath = LS.getLastOpenedFolder();
if (APP.newSharedFolder) { if (APP.newSharedFolder) {
var newSFPaths = manager.findFile(APP.newSharedFolder); var newSFPaths = manager.findFile(Number(APP.newSharedFolder));
if (newSFPaths.length) { if (newSFPaths.length) {
currentPath = newSFPaths[0]; currentPath = newSFPaths[0];
} }
@ -672,6 +672,8 @@ define([
displayedCategories = [FILES_DATA]; displayedCategories = [FILES_DATA];
currentPath = [FILES_DATA]; currentPath = [FILES_DATA];
} }
} else if (priv.isEmbed && APP.newSharedFolder) {
displayedCategories = [ROOT, TRASH];
} }
APP.editable = !APP.readOnly; APP.editable = !APP.readOnly;
@ -2395,6 +2397,7 @@ define([
path.forEach(function (p, idx) { path.forEach(function (p, idx) {
if (isTrash && [2,3].indexOf(idx) !== -1) { return; } if (isTrash && [2,3].indexOf(idx) !== -1) { return; }
if (skipNext) { skipNext = false; return; } if (skipNext) { skipNext = false; return; }
if (APP.newSharedFolder && priv.isEmbed && p === ROOT && !idx) { return; }
var name = p; var name = p;
if (manager.isFile(el) && isInTrashRoot && idx === 1) { if (manager.isFile(el) && isInTrashRoot && idx === 1) {
@ -2435,7 +2438,7 @@ define([
addDragAndDropHandlers($span, path.slice(0, idx), true, true); addDragAndDropHandlers($span, path.slice(0, idx), true, true);
if (idx === 0) { name = p === SHARED_FOLDER ? name : getPrettyName(p); } if (idx === 0) { name = p === SHARED_FOLDER ? name : getPrettyName(p); }
else { else if (!(APP.newSharedFolder && priv.isEmbed && idx === 1)) {
var $span2 = $('<span>', { var $span2 = $('<span>', {
'class': 'cp-app-drive-path-element cp-app-drive-path-separator' 'class': 'cp-app-drive-path-element cp-app-drive-path-separator'
}).text(' / '); }).text(' / ');
@ -4103,17 +4106,28 @@ define([
var createTree = function ($container, path) { var createTree = function ($container, path) {
var root = manager.find(path); var root = manager.find(path);
var isRoot = manager.comparePath([ROOT], path);
var rootName = ROOT_NAME;
if (APP.newSharedFolder && priv.isEmbed && isRoot) {
var newSFPaths = manager.findFile(Number(APP.newSharedFolder));
if (newSFPaths.length) {
path = newSFPaths[0];
path.push(ROOT);
root = manager.find(path);
rootName = manager.getSharedFolderData(APP.newSharedFolder).title;
}
}
// don't try to display what doesn't exist // don't try to display what doesn't exist
if (!root) { return; } if (!root) { return; }
// Display the root element in the tree // Display the root element in the tree
var displayingRoot = manager.comparePath([ROOT], path); if (isRoot) {
if (displayingRoot) { var isRootOpened = manager.comparePath(path.slice(), currentPath);
var isRootOpened = manager.comparePath([ROOT], currentPath);
var $rootIcon = manager.isFolderEmpty(files[ROOT]) ? var $rootIcon = manager.isFolderEmpty(files[ROOT]) ?
(isRootOpened ? $folderOpenedEmptyIcon : $folderEmptyIcon) : (isRootOpened ? $folderOpenedEmptyIcon : $folderEmptyIcon) :
(isRootOpened ? $folderOpenedIcon : $folderIcon); (isRootOpened ? $folderOpenedIcon : $folderIcon);
var $rootElement = createTreeElement(ROOT_NAME, $rootIcon.clone(), [ROOT], false, true, true, isRootOpened); var $rootElement = createTreeElement(rootName, $rootIcon.clone(), path.slice(), false, true, true, isRootOpened);
if (!manager.hasSubfolder(root)) { if (!manager.hasSubfolder(root)) {
$rootElement.find('.cp-app-drive-icon-expcol').css('visibility', 'hidden'); $rootElement.find('.cp-app-drive-icon-expcol').css('visibility', 'hidden');
} }

@ -548,6 +548,8 @@ define([
var secret = Hash.getSecrets('drive', parsed.hash, folderData.password); var secret = Hash.getSecrets('drive', parsed.hash, folderData.password);
SF.upgrade(secret.channel, secret); SF.upgrade(secret.channel, secret);
Env.folders[folderId].userObject.setReadOnly(false, secret.keys.secondaryKey); Env.folders[folderId].userObject.setReadOnly(false, secret.keys.secondaryKey);
waitFor.abort();
return void cb(folderId);
} }
if (err) { if (err) {
waitFor.abort(); waitFor.abort();

Loading…
Cancel
Save