From 98daf10ed1bc9add28b76c60d2d4aabb77481ac4 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 22 Aug 2017 14:54:41 +0200 Subject: [PATCH] Ability to collapse the root directory in the drive --- www/drive/file.less | 21 ++++++++++++++++++++- www/drive/main.js | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/www/drive/file.less b/www/drive/file.less index ccf92651f..e639216c6 100644 --- a/www/drive/file.less +++ b/www/drive/file.less @@ -190,7 +190,8 @@ span { } .docTree { margin-top: 20px; - padding: 0 0 0 20px; + //padding: 0 0 0 20px; + padding: 0; cursor: auto; &li, li { padding: 0; @@ -304,6 +305,24 @@ span { top: -1px; } } + .docTree { + .root > .element-row > .expcol { + position: relative; + top:0; + left: -10px; + } + .root > .element-row > .folder { + margin-left: -5px; + } + .root { + &> .element-row { + padding-left: 20px; + } + &> ul { + padding-left: 30px; + } + } + } // Expand/collapse lines .docTree ul { diff --git a/www/drive/main.js b/www/drive/main.js index 07ed2dd7c..35ed9d0d5 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -2092,7 +2092,10 @@ define([ var $rootIcon = filesOp.isFolderEmpty(files[ROOT]) ? (isRootOpened ? $folderOpenedEmptyIcon : $folderEmptyIcon) : (isRootOpened ? $folderOpenedIcon : $folderIcon); - var $rootElement = createTreeElement(ROOT_NAME, $rootIcon.clone(), [ROOT], false, true, false, isRootOpened); + var $rootElement = createTreeElement(ROOT_NAME, $rootIcon.clone(), [ROOT], false, true, true, isRootOpened); + if (!filesOp.hasSubfolder(root)) { + $rootElement.find('.expcol').css('visibility', 'hidden'); + } $rootElement.addClass('root'); $rootElement.find('>.element-row').contextmenu(openDirectoryContextMenu); $('