|
@@ -2,13 +2,15 @@
|
|
<section
|
|
<section
|
|
:uuid="item.uuid"
|
|
:uuid="item.uuid"
|
|
:level="level"
|
|
:level="level"
|
|
|
|
+ :type="item.type"
|
|
|
|
+ class="tocitem"
|
|
>
|
|
>
|
|
<component
|
|
<component
|
|
:is="titlelevel"
|
|
:is="titlelevel"
|
|
v-if="title"
|
|
v-if="title"
|
|
class="toc-title"
|
|
class="toc-title"
|
|
:uuid="item.uuid"
|
|
:uuid="item.uuid"
|
|
- :class="{active: isActive, loaded: isLoaded}"
|
|
|
|
|
|
+ :class="{active: isActive, loaded: isLoaded, notitle: noTitle}"
|
|
>
|
|
>
|
|
<a
|
|
<a
|
|
:href="'/edition/'+editionid+'/'+item.uuid"
|
|
:href="'/edition/'+editionid+'/'+item.uuid"
|
|
@@ -56,7 +58,8 @@ export default {
|
|
loadedtextsuuids: Array
|
|
loadedtextsuuids: Array
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
- isOpened: false
|
|
|
|
|
|
+ isOpened: false,
|
|
|
|
+ noTitle: false
|
|
}),
|
|
}),
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
@@ -74,8 +77,11 @@ export default {
|
|
// this shoudn't be necessary
|
|
// this shoudn't be necessary
|
|
if (this.item.title && Array.isArray(this.item.title)) {
|
|
if (this.item.title && Array.isArray(this.item.title)) {
|
|
return this.item.title.join(' ')
|
|
return this.item.title.join(' ')
|
|
- } else {
|
|
|
|
|
|
+ } else if (this.item.title) {
|
|
return this.item.title
|
|
return this.item.title
|
|
|
|
+ } else {
|
|
|
|
+ console.log('TOC no title', this.item)
|
|
|
|
+ return this.item.type
|
|
}
|
|
}
|
|
},
|
|
},
|
|
titlelevel () {
|
|
titlelevel () {
|
|
@@ -116,6 +122,12 @@ export default {
|
|
if (typeof this.$route.params.textid !== 'undefined') {
|
|
if (typeof this.$route.params.textid !== 'undefined') {
|
|
this.isOpened = this.$route.params.textid.indexOf(this.item.uuid) >= 0
|
|
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: {
|
|
methods: {
|
|
...mapActions({
|
|
...mapActions({
|