click toc add item to history #810

This commit is contained in:
2022-02-03 20:17:08 +01:00
parent 561038ef36
commit ae91e8bf1e
3 changed files with 26 additions and 5 deletions
+3 -3
View File
@@ -28,8 +28,8 @@ that is currently Firefox-only */
body{
color: #1a1a1a;
background-image: url('/static/img/grille-ligne-de-base.png');
background-repeat: repeat;
// background-image: url('/static/img/grille-ligne-de-base.png');
// background-repeat: repeat;
}
#root{
@@ -446,7 +446,7 @@ section[role="main-content"]{
padding-right: 0;
>.wrapper{
padding-right: $pagenum_w*2;
outline: orange solid thin;
// outline: orange solid thin;
}
div#text{
// .infinite-loading-container{
+3 -1
View File
@@ -17,7 +17,9 @@
/>
</h2>
<!-- <p v-if="preview" class="preview" v-html="preview" /> -->
<aside>
<aside
v-if="item.pages"
>
<span>{{ item.pages.prefix }} {{ item.pages.range }}</span> | <span>{{ item.size.quantity }} {{ item.size.unit }}</span>
</aside>
</article>
+20 -1
View File
@@ -42,6 +42,8 @@
import TocItem from './TocItem'
import { mapState, mapActions } from 'vuex'
export default {
name: 'TocItem',
components: {
@@ -57,6 +59,12 @@ export default {
isOpened: false
}),
computed: {
...mapState({
editionsbyuuid: state => state.Corpus.editionsbyuuid
}),
editionTitle () {
return this.editionsbyuuid[this.editionid].title
},
children () {
// check if children exists and if it is an array
// this shoudn't be necessary
@@ -110,8 +118,19 @@ export default {
}
},
methods: {
...mapActions({
addHistoryItem: 'History/addItem'
}),
onclick (e) {
// console.log('clicked on toc text', this.editionid, e)
console.log('clicked on toc text', this.item, e)
this.addHistoryItem({
id: this.editionid,
textid: this.item.uuid,
title: this.item.title,
editionTitle: this.editionTitle
// pages: this.item.pages,
// size: this.item.size
})
this.$emit('onClickTocItem', e.target.getAttribute('uuid'))
},
onClickTocItem (uuid) {