From 4da8a4d176103f7bc0d503a5280821e903557be6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 25 Oct 2018 23:04:14 -0400 Subject: [PATCH] nested folders and collections --- jslib | 2 +- src/app/vault/groupings.component.html | 47 +++++++--- src/app/vault/groupings.component.ts | 2 + src/scss/vault.scss | 122 ++++++++++++++++++++++++- 4 files changed, 154 insertions(+), 19 deletions(-) diff --git a/jslib b/jslib index 4165a782..b0eea9d7 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 4165a78277048d7b37319e63bd7e6473cbba5156 +Subproject commit b0eea9d7cefdc5453750f49985689fefa1fa53a5 diff --git a/src/app/vault/groupings.component.html b/src/app/vault/groupings.component.html index b14eb519..ff9e4bad 100644 --- a/src/app/vault/groupings.component.html +++ b/src/app/vault/groupings.component.html @@ -44,24 +44,43 @@

{{'collections' | i18n}}

diff --git a/src/app/vault/groupings.component.ts b/src/app/vault/groupings.component.ts index d3ce8961..656d0a81 100644 --- a/src/app/vault/groupings.component.ts +++ b/src/app/vault/groupings.component.ts @@ -12,5 +12,7 @@ import { GroupingsComponent as BaseGroupingsComponent } from 'jslib/angular/comp export class GroupingsComponent extends BaseGroupingsComponent { constructor(collectionService: CollectionService, folderService: FolderService) { super(collectionService, folderService); + this.loadNestedCollections = true; + this.loadNestedFolders = true; } } diff --git a/src/scss/vault.scss b/src/scss/vault.scss index 64236617..caa570cd 100644 --- a/src/scss/vault.scss +++ b/src/scss/vault.scss @@ -27,6 +27,10 @@ .inner-content { padding-bottom: 0; padding-right: 5px; + + > ul { + margin: 0 0 15px 0; + } } h2 { @@ -71,23 +75,122 @@ word-break: break-all; .fa-li { - left: -11px; top: 8px; } + } + } - a { + // Nested indentions + ul.fa-ul { + // Level 1 + li { + > a { padding-left: 12px; } - &.active .fa-li { + .fa-li { + left: -11px; + } + + &.active > a .fa-li { left: 4px; } } + + // Level 2 + ul li { + > a { + padding-left: 23px; + } + + .fa-li { + left: 0; + } + + &.active > a .fa-li { + left: 15px; + } + } + + // Level 3 + ul ul li { + > a { + padding-left: 34px; + } + + .fa-li { + left: 11px; + } + + &.active > a .fa-li { + left: 26px; + } + } + + // Level 4 + ul ul ul li { + > a { + padding-left: 45px; + } + + .fa-li { + left: 22px; + } + + &.active > a .fa-li { + left: 37px; + } + } + + // Level 5 + ul ul ul ul li { + > a { + padding-left: 56px; + } + + .fa-li { + left: 33px; + } + + &.active > a .fa-li { + left: 48px; + } + } + + // Level 6 + ul ul ul ul ul li { + > a { + padding-left: 67px; + } + + .fa-li { + left: 44px; + } + + &.active > a .fa-li { + left: 59px; + } + } + + // Level 7 + ul ul ul ul ul ul li { + > a { + padding-left: 78px; + } + + .fa-li { + left: 55px; + } + + &.active > a .fa-li { + left: 70px; + } + } } ul { padding: 0; - margin: 0 0 15px 0; + margin: 0; li { a { @@ -130,6 +233,17 @@ @include themify($themes) { background-color: themed('groupingsActiveColor'); } + + ul { + @include themify($themes) { + background-color: themed('backgroundColorAlt'); + } + + margin-left: -15px; + margin-right: -5px; + padding-left: 15px; + padding-right: 5px; + } } } }