From 232b44f3c683dd481a344aa65906c3e8b60ddab9 Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 20 Feb 2023 16:51:52 +0100 Subject: [PATCH] displaying TOC items types & item without titles #1255 --- assets/css/app.scss | 14 ++++++++++++++ src/components/Content/TocItem.vue | 18 +++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index 9e136c2..b3cfc78 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -818,6 +818,17 @@ section[role="main-content"]{ overflow-x: hidden; overflow-y: auto; line-height: $base-line / 2; + section.tocitem{ + position: relative; + &:after{ + display: block; + position:absolute; + top:0; right:0; + color: red; + content: attr(type); + font-size: 11px; + } + } >ul{ ul{ li{ @@ -859,6 +870,9 @@ section[role="main-content"]{ &.loaded{ color:$grisfonce; } + &.notitle{ + color: red; + } } h2.toc-title{font-size: 1.1em;} h3.toc-title{font-size: 1em;} diff --git a/src/components/Content/TocItem.vue b/src/components/Content/TocItem.vue index 929d261..fd8fa45 100644 --- a/src/components/Content/TocItem.vue +++ b/src/components/Content/TocItem.vue @@ -2,13 +2,15 @@
({ - isOpened: false + isOpened: false, + noTitle: false }), computed: { ...mapState({ @@ -74,8 +77,11 @@ export default { // this shoudn't be necessary if (this.item.title && Array.isArray(this.item.title)) { return this.item.title.join(' ') - } else { + } else if (this.item.title) { return this.item.title + } else { + console.log('TOC no title', this.item) + return this.item.type } }, titlelevel () { @@ -116,6 +122,12 @@ export default { if (typeof this.$route.params.textid !== 'undefined') { this.isOpened = this.$route.params.textid.indexOf(this.item.uuid) >= 0 } + if (['book', 'volume'].indexOf(this.item.type) >= 0) { + this.isOpened = true + } + if (!this.item.title) { + this.noTitle = true + } }, methods: { ...mapActions({