marked extract of search on text (scrolling is not working yet
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
:uuid="text.content.uuid"
|
||||
:url="text.content.url"
|
||||
:textid="textid"
|
||||
:extract="extract"
|
||||
@onHoverLink="onHoverLink"
|
||||
@onLeaveLink="onLeaveLink"
|
||||
/>
|
||||
@@ -177,6 +178,13 @@ export default {
|
||||
if (to.params.textid) {
|
||||
// change textid when route change
|
||||
this.textid = to.params.textid
|
||||
// change also extract if exists
|
||||
if (to.params.extract) {
|
||||
console.log('extract params from route', to.params.extract)
|
||||
this.extract = to.params.extract
|
||||
// scrolling is not working :(
|
||||
this.reftoscrollto = '#mark-1'
|
||||
}
|
||||
} else if (this.toc) {
|
||||
// if no textid in new route (e.g. edition front)
|
||||
// but we have toc
|
||||
@@ -187,6 +195,9 @@ export default {
|
||||
this.textid = null
|
||||
}
|
||||
},
|
||||
reftoscrollto (newref, oldref) {
|
||||
console.log('reftoscrollto changed', oldref, newref)
|
||||
},
|
||||
textid (newid, oldid) {
|
||||
console.log('textid watcher', this, oldid, newid)
|
||||
this.texts = []
|
||||
@@ -220,6 +231,13 @@ export default {
|
||||
this.textid = this.$route.params.textid
|
||||
}
|
||||
|
||||
// get the searchkeys from route param (only comming from result item) for text highlighting
|
||||
if (this.$route.params.extract) {
|
||||
this.extract = this.$route.params.extract
|
||||
// scrolling is not working :(
|
||||
this.reftoscrollto = '#mark-1'
|
||||
}
|
||||
|
||||
// wait for editions list from Corpus Store if not already loaded
|
||||
if (!this.corpusLoaded) {
|
||||
// this.getCorpuses()
|
||||
|
||||
Reference in New Issue
Block a user