diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index d287951b5..5feb22ca3 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -286,7 +286,9 @@ display: none; } input { - width: ~"calc(100% - 30px)"; + //width: ~"calc(100% - 30px)"; + flex: 1; + min-width: 0; padding: 0 10px; border: 0; height: auto; @@ -298,8 +300,9 @@ .leftside-menu-category_main(); width: ~"calc(100% + 5px)"; margin: 0; - margin-bottom: -6px; - display: inline-block; + //margin-bottom: -6px; + display: flex; + align-items: center; cursor: pointer; margin-left: -5px; padding-left: 5px; @@ -309,6 +312,12 @@ width: 25px; margin-right: 0px; } + .cp-app-drive-element { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + } } } } diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 32a7e7111..165ac7b02 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -643,7 +643,7 @@ define([ // DRIVE var currentPath = APP.currentPath = LS.getLastOpenedFolder(); if (APP.newSharedFolder) { - var newSFPaths = manager.findFile(APP.newSharedFolder); + var newSFPaths = manager.findFile(Number(APP.newSharedFolder)); if (newSFPaths.length) { currentPath = newSFPaths[0]; } @@ -672,6 +672,8 @@ define([ displayedCategories = [FILES_DATA]; currentPath = [FILES_DATA]; } + } else if (priv.isEmbed && APP.newSharedFolder) { + displayedCategories = [ROOT, TRASH]; } APP.editable = !APP.readOnly; @@ -2395,6 +2397,7 @@ define([ path.forEach(function (p, idx) { if (isTrash && [2,3].indexOf(idx) !== -1) { return; } if (skipNext) { skipNext = false; return; } + if (APP.newSharedFolder && priv.isEmbed && p === ROOT && !idx) { return; } var name = p; if (manager.isFile(el) && isInTrashRoot && idx === 1) { @@ -2435,7 +2438,7 @@ define([ addDragAndDropHandlers($span, path.slice(0, idx), true, true); if (idx === 0) { name = p === SHARED_FOLDER ? name : getPrettyName(p); } - else { + else if (!(APP.newSharedFolder && priv.isEmbed && idx === 1)) { var $span2 = $('', { 'class': 'cp-app-drive-path-element cp-app-drive-path-separator' }).text(' / '); @@ -4103,17 +4106,28 @@ define([ var createTree = function ($container, 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 if (!root) { return; } // Display the root element in the tree - var displayingRoot = manager.comparePath([ROOT], path); - if (displayingRoot) { - var isRootOpened = manager.comparePath([ROOT], currentPath); + if (isRoot) { + var isRootOpened = manager.comparePath(path.slice(), currentPath); var $rootIcon = manager.isFolderEmpty(files[ROOT]) ? (isRootOpened ? $folderOpenedEmptyIcon : $folderEmptyIcon) : (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)) { $rootElement.find('.cp-app-drive-icon-expcol').css('visibility', 'hidden'); } diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index d87572d7e..5cf44b467 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -548,6 +548,8 @@ define([ var secret = Hash.getSecrets('drive', parsed.hash, folderData.password); SF.upgrade(secret.channel, secret); Env.folders[folderId].userObject.setReadOnly(false, secret.keys.secondaryKey); + waitFor.abort(); + return void cb(folderId); } if (err) { waitFor.abort();