|
@@ -1,5 +1,5 @@
|
|
<template lang="html">
|
|
<template lang="html">
|
|
- <div class="page wh-100" :class="'page-' + slug">
|
|
|
|
|
|
+ <div class="page" :class="'page-' + slug">
|
|
<div class="page-wrapper" v-html="page.content" />
|
|
<div class="page-wrapper" v-html="page.content" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -13,16 +13,9 @@ export default {
|
|
slug: { type: String, required: true }
|
|
slug: { type: String, required: true }
|
|
},
|
|
},
|
|
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- links: undefined
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
methods: {
|
|
methods: {
|
|
addFootnotes () {
|
|
addFootnotes () {
|
|
const links = this.$el.querySelectorAll('.page-wrapper a')
|
|
const links = this.$el.querySelectorAll('.page-wrapper a')
|
|
- console.log('addFootnotes', links)
|
|
|
|
links.forEach((link, i) => {
|
|
links.forEach((link, i) => {
|
|
const number = parseInt(link.hash.replace('#', ''))
|
|
const number = parseInt(link.hash.replace('#', ''))
|
|
if (!isNaN(number)) {
|
|
if (!isNaN(number)) {
|
|
@@ -38,8 +31,6 @@ export default {
|
|
this.addFootnoteContent(link, i)
|
|
this.addFootnoteContent(link, i)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
- this.links = links
|
|
|
|
},
|
|
},
|
|
|
|
|
|
addFootnoteContent (link, i) {
|
|
addFootnoteContent (link, i) {
|
|
@@ -51,13 +42,14 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
onFootnoteLinkClick (e) {
|
|
onFootnoteLinkClick (e) {
|
|
- document.getElementById(e.target.id + '-content').classList.toggle('show')
|
|
|
|
- console.log('onFootnoteLinkClick', e.target.dataset.number, e)
|
|
|
|
|
|
+ const container = document.getElementById(e.target.id + '-content')
|
|
|
|
+ if (container) {
|
|
|
|
+ container.classList.toggle('show')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
mounted () {
|
|
mounted () {
|
|
- console.log('mounted', this.page.notes)
|
|
|
|
if (this.page.notes) this.addFootnotes()
|
|
if (this.page.notes) this.addFootnotes()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -65,6 +57,12 @@ export default {
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.page {
|
|
.page {
|
|
|
|
+ font-size: 1rem;
|
|
|
|
+
|
|
|
|
+ @include media-breakpoint-up($size-bp) {
|
|
|
|
+ font-size: 1.5rem;
|
|
|
|
+ }
|
|
|
|
+
|
|
padding: $node-view-spacer-sm-y $node-view-spacer-sm-x;
|
|
padding: $node-view-spacer-sm-y $node-view-spacer-sm-x;
|
|
|
|
|
|
@include media-breakpoint-up($size-bp) {
|
|
@include media-breakpoint-up($size-bp) {
|
|
@@ -135,7 +133,5 @@ export default {
|
|
margin: 0 0 1em 2em;
|
|
margin: 0 0 1em 2em;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|