some refactoring, better toc
This commit is contained in:
+10
-2
@@ -261,14 +261,22 @@ section[role="main-content"]{
|
|||||||
li{
|
li{
|
||||||
ul{
|
ul{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
max-height: 1000px;
|
||||||
|
transition: max-height 0.5s ease-in-out;
|
||||||
|
// transform: scaleY(1);
|
||||||
|
// transform-origin: top;
|
||||||
|
// transition: transform 0.3s ease-in-out;
|
||||||
&:not(.opened){
|
&:not(.opened){
|
||||||
height:0;
|
// height:0;
|
||||||
|
max-height:0;
|
||||||
|
transition: max-height 0.5s cubic-bezier(0, 1.05, 0, 1);
|
||||||
|
// transform: scaleY(0);
|
||||||
}
|
}
|
||||||
// &.opened{
|
// &.opened{
|
||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
// }
|
// }
|
||||||
// padding-left: 1em;
|
// padding-left: 1em;
|
||||||
border-left: 0.5px solid $gris;
|
border-left: 0.5px solid $grisclair;
|
||||||
// min-height: 1em;
|
// min-height: 1em;
|
||||||
margin-bottom: 0em;
|
margin-bottom: 0em;
|
||||||
li{
|
li{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
$bleuroi: rgb(61,82,102);
|
$bleuroi: rgb(61,82,102);
|
||||||
$gris: rgb(200,204,204);
|
$gris: rgb(200,204,204);
|
||||||
|
$grisclair: rgb(230,234,234);
|
||||||
$grisfonce: rgb(57,57,64);
|
$grisfonce: rgb(57,57,64);
|
||||||
$or: rgb(179,161,125);
|
$or: rgb(179,161,125);
|
||||||
$rouge: rgb(204,61,82);
|
$rouge: rgb(204,61,82);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<ul>
|
<ul>
|
||||||
<li
|
<li
|
||||||
v-for="item in content"
|
v-for="item in toc"
|
||||||
:key="item.uuid"
|
:key="item.uuid"
|
||||||
>
|
>
|
||||||
<TocItem :item="item" :level="1" :editionid="$route.params.id" />
|
<TocItem :item="item" :level="1" :editionid="$route.params.id" />
|
||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
TocItem
|
TocItem
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
content: Object
|
toc: Array
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
v-if="title"
|
v-if="title"
|
||||||
class="toc-title"
|
class="toc-title"
|
||||||
:uuid="item.uuid"
|
:uuid="item.uuid"
|
||||||
v-bind:class="{active: isActive}"
|
:class="{active: isActive}"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
:href="'/edition/'+editionid+'/'+item.uuid"
|
:href="'/edition/'+editionid+'/'+item.uuid"
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<ul
|
<ul
|
||||||
v-if="children.length"
|
v-if="children.length"
|
||||||
class="toc-list"
|
class="toc-list"
|
||||||
v-bind:class="{opened: isOpened}"
|
:class="{opened: isOpened}"
|
||||||
>
|
>
|
||||||
<li v-for="child in children" :key="child.uuid">
|
<li v-for="child in children" :key="child.uuid">
|
||||||
<TocItem :item="child" :level="nextLevel" :editionid="editionid" />
|
<TocItem :item="child" :level="nextLevel" :editionid="editionid" />
|
||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
onclick (e) {
|
onclick (e) {
|
||||||
console.log('clicked on toc text', this.editionid, e)
|
console.log('clicked on toc text', this.editionid, e)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: `editiontoctext`,
|
name: `editiontext`,
|
||||||
params: {
|
params: {
|
||||||
id: this.editionid,
|
id: this.editionid,
|
||||||
textid: e.target.getAttribute('uuid')
|
textid: e.target.getAttribute('uuid')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<EdText v-if="textdata" :textdata="textdata" />
|
<EdText v-if="textdata" :textdata="textdata" />
|
||||||
|
|
||||||
<template #nav>
|
<template #nav>
|
||||||
<EdToc :content="content" />
|
<EdToc :toc="toc" />
|
||||||
</template>
|
</template>
|
||||||
</MainContentLayout>
|
</MainContentLayout>
|
||||||
</template>
|
</template>
|
||||||
@@ -24,14 +24,14 @@ import EdText from '../components/Content/EdText'
|
|||||||
import EdToc from '../components/Content/EdToc'
|
import EdToc from '../components/Content/EdToc'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EditionToc',
|
name: 'Edition',
|
||||||
components: {
|
components: {
|
||||||
MainContentLayout,
|
MainContentLayout,
|
||||||
EdText,
|
EdText,
|
||||||
EdToc
|
EdToc
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
content: null,
|
toc: null,
|
||||||
meta: null,
|
meta: null,
|
||||||
editionid: null,
|
editionid: null,
|
||||||
textid: null,
|
textid: null,
|
||||||
@@ -39,7 +39,7 @@ export default {
|
|||||||
}),
|
}),
|
||||||
watch: {
|
watch: {
|
||||||
textid: function (newid, oldid) {
|
textid: function (newid, oldid) {
|
||||||
// console.log('textid watcher', this, newid, oldid)
|
console.log('textid watcher', this, oldid, newid)
|
||||||
this.getTextContent()
|
this.getTextContent()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -54,9 +54,14 @@ export default {
|
|||||||
this.meta = data.meta
|
this.meta = data.meta
|
||||||
if (data.content) {
|
if (data.content) {
|
||||||
if (Array.isArray(data.content)) {
|
if (Array.isArray(data.content)) {
|
||||||
this.content = data.content
|
this.toc = data.content
|
||||||
} else {
|
} else {
|
||||||
this.content = [data.content]
|
this.toc = [data.content]
|
||||||
|
}
|
||||||
|
// if front page get the first item in toc
|
||||||
|
if (!this.$route.params.textid) {
|
||||||
|
// console.log('toc', this.toc)
|
||||||
|
this.textid = this.toc[0].children[1].uuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -69,7 +74,6 @@ export default {
|
|||||||
// get the text if textid available
|
// get the text if textid available
|
||||||
if (this.$route.params.textid) {
|
if (this.$route.params.textid) {
|
||||||
this.textid = this.$route.params.textid
|
this.textid = this.$route.params.textid
|
||||||
// this.getTextContent()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteUpdate (to, from, next) {
|
beforeRouteUpdate (to, from, next) {
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
onclick (e) {
|
onclick (e) {
|
||||||
console.log('clicked on editon', e)
|
console.log('clicked on editon', e)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: `editiontoc`,
|
name: `edition`,
|
||||||
params: { id: e.target.getAttribute('uuid') }
|
params: { id: e.target.getAttribute('uuid') }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -5,7 +5,7 @@ import Home from 'pages/Home'
|
|||||||
import Item from 'pages/Item'
|
import Item from 'pages/Item'
|
||||||
import ListCorpus from 'pages/ListCorpus'
|
import ListCorpus from 'pages/ListCorpus'
|
||||||
// import Corpus from 'pages/Corpus'
|
// import Corpus from 'pages/Corpus'
|
||||||
import EditionToc from 'pages/EditionToc'
|
import Edition from 'pages/Edition'
|
||||||
import IndexNominum from 'pages/IndexNominum'
|
import IndexNominum from 'pages/IndexNominum'
|
||||||
import IndexLocorum from 'pages/IndexLocorum'
|
import IndexLocorum from 'pages/IndexLocorum'
|
||||||
import IndexOperum from 'pages/IndexOperum'
|
import IndexOperum from 'pages/IndexOperum'
|
||||||
@@ -39,14 +39,14 @@ const routes = [
|
|||||||
// component: Corpus
|
// component: Corpus
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
name: 'editiontoc',
|
name: 'edition',
|
||||||
path: '/edition/:id',
|
path: '/edition/:id',
|
||||||
component: EditionToc
|
component: Edition
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'editiontoctext',
|
name: 'editiontext',
|
||||||
path: '/edition/:id/:textid',
|
path: '/edition/:id/:textid',
|
||||||
component: EditionToc
|
component: Edition
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'indexNominum',
|
name: 'indexNominum',
|
||||||
|
|||||||
Reference in New Issue
Block a user