transversal links to nav history #786, restored scrolls

This commit is contained in:
2020-07-21 17:38:27 +02:00
parent 44388adaf8
commit f0b6a79bc7
6 changed files with 133 additions and 88 deletions
+21 -12
View File
@@ -1,16 +1,25 @@
<template>
<article class="history item">
<header>
<h1>
<a
:href="item.url"
@click.prevent="onclick"
@keyup.enter="onclick"
v-html="item.textId"
/>
</h1>
</header>
<div class="extract" v-html="item.extract" />
<article class="result item">
<h1>
<a
:href="'/edition/'+item.textId+'/'+item.uuid"
@click.prevent="onclick"
@keyup.enter="onclick"
v-html="item.title"
/>
</h1>
<h2>
<a
:href="'/edition/'+item.textId+'/'+item.uuid"
@click.prevent="onclick"
@keyup.enter="onclick"
v-html="item.editionTitle"
/>
</h2>
<!-- <p v-if="preview" class="preview" v-html="preview" /> -->
<aside>
<span>Pagination</span> | <span>Nbr mots</span>
</aside>
</article>
</template>
+20 -1
View File
@@ -37,6 +37,7 @@
<script>
import { REST } from 'api/rest-axios'
import { mapState, mapActions } from 'vuex'
export default {
name: 'Occurence',
@@ -49,6 +50,14 @@ export default {
isopened: false,
tei: ''
}),
computed: {
...mapState({
editionsbyuuid: state => state.Corpus.editionsbyuuid
}),
editionTitle () {
return this.editionsbyuuid[this.ed.item].title
}
},
created () {
console.log('occurence beforeCreate')
REST.get(`${window.apipath}/items/` + this.oc.uuid, {})
@@ -66,9 +75,19 @@ export default {
})
},
methods: {
...mapActions({
addHistoryItem: 'History/addItem'
}),
onGoToText (e) {
console.log('clicked on text occurence', e)
console.log('clicked on text occurence', e, this.oc.title, this.ed)
if (e.target.getAttribute('eduuid')) {
this.addHistoryItem({
id: e.target.getAttribute('eduuid'),
textid: e.target.getAttribute('uuid'),
title: this.oc.title,
editionTitle: this.editionTitle
})
this.$router.push({
name: `editiontext`,
params: {
+13 -1
View File
@@ -60,7 +60,19 @@ export default {
}),
onclick () {
console.log('clicked on result item', this.result)
this.addHistoryItem(this.result)
this.addHistoryItem({
id: this.result.textId,
textid: this.result.uuid,
title: this.result.title[0],
editionTitle: this.editionTitle
})
this.$router.push({
name: `editiontext`,
params: {
id: this.result.textId,
textid: this.result.uuid
}
})
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<div id="search" class="col-11">
<form class="search-form row">
<fieldset class="search col-2">
<fieldset class="search">
<div>
<label for="keys">Search</label>
<input