#2161 bug fixe
This commit is contained in:
@@ -101,7 +101,7 @@ export default {
|
|||||||
let itemparts, icon, newspan
|
let itemparts, icon, newspan
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
itemparts = RegExp(/<span[^>]*class="([^"]+)"[^>]*>.+<\/span>/g).exec(items[i], 'g')
|
itemparts = RegExp(/<span[^>]*class="([^"]+)"[^>]*>.+<\/span>/g).exec(items[i], 'g')
|
||||||
console.log('itemparts', itemparts)
|
// console.log('itemparts', itemparts)
|
||||||
switch (itemparts[1]) {
|
switch (itemparts[1]) {
|
||||||
case 'placeName':
|
case 'placeName':
|
||||||
icon = '<span class="index-item-icon mdi mdi-map-marker"></span>'
|
icon = '<span class="index-item-icon mdi mdi-map-marker"></span>'
|
||||||
|
|||||||
@@ -51,12 +51,16 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
let max = 40
|
let max = 40
|
||||||
|
if (this.result.title) {
|
||||||
if (this.result.title.length > max) {
|
if (this.result.title.length > max) {
|
||||||
let subString = this.result.title.substr(0, max)
|
let subString = this.result.title.substr(0, max)
|
||||||
this.shorted_title = subString.substr(0, subString.lastIndexOf(' ')) + ' …'
|
this.shorted_title = subString.substr(0, subString.lastIndexOf(' ')) + ' …'
|
||||||
} else {
|
} else {
|
||||||
this.shorted_title = this.result.title
|
this.shorted_title = this.result.title
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`no result title for ${this.result.uuid}`, this.result)
|
||||||
|
}
|
||||||
// if (this.result.extract) {
|
// if (this.result.extract) {
|
||||||
// const subString = this.result.extract.substr(0, 80)
|
// const subString = this.result.extract.substr(0, 80)
|
||||||
// this.preview = subString.substr(0, subString.lastIndexOf(' ')) + ' …'
|
// this.preview = subString.substr(0, subString.lastIndexOf(' ')) + ' …'
|
||||||
|
|||||||
+13
-4
@@ -224,6 +224,9 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
$route (to, from) {
|
$route (to, from) {
|
||||||
console.log('Edition Watcher $route', from, to)
|
console.log('Edition Watcher $route', from, to)
|
||||||
|
if (to.params.id !== this.editionid) {
|
||||||
|
this.setValues()
|
||||||
|
}
|
||||||
if (to.params.textid) {
|
if (to.params.textid) {
|
||||||
// change textid when route change
|
// change textid when route change
|
||||||
this.textid = to.params.textid
|
this.textid = to.params.textid
|
||||||
@@ -274,6 +277,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this.setValues()
|
||||||
|
},
|
||||||
|
// updated () {
|
||||||
|
// this.setValues()
|
||||||
|
// },
|
||||||
|
methods: {
|
||||||
|
...mapActions({
|
||||||
|
getCorpuses: 'Corpus/getCorpuses'
|
||||||
|
}),
|
||||||
|
setValues () {
|
||||||
// console.log('Edition this.$route.params.id', this.$route.params.id)
|
// console.log('Edition this.$route.params.id', this.$route.params.id)
|
||||||
this.editionid = this.$route.params.id
|
this.editionid = this.$route.params.id
|
||||||
|
|
||||||
@@ -354,10 +367,6 @@ export default {
|
|||||||
this.pagination = this.editionsbyuuid[this.editionid].pagination
|
this.pagination = this.editionsbyuuid[this.editionid].pagination
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
...mapActions({
|
|
||||||
getCorpuses: 'Corpus/getCorpuses'
|
|
||||||
}),
|
|
||||||
getTextContent (textid, $state = null, direction = 'next') {
|
getTextContent (textid, $state = null, direction = 'next') {
|
||||||
console.log('getTextContent', textid)
|
console.log('getTextContent', textid)
|
||||||
let params = {
|
let params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user