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