added text preview in index item's occurences list

This commit is contained in:
2020-07-17 12:59:48 +02:00
parent 3dea69e9c5
commit 4c2288cf97
4 changed files with 159 additions and 36 deletions
+6 -30
View File
@@ -24,17 +24,7 @@
v-for="oc in ed.occurences"
:key="oc.uuid"
> -->
<h4>
<a
:href="'/edition/'+ed.item+'/'+oc.uuid"
:uuid="oc.uuid"
:eduuid="ed.item"
@click.prevent="onclick"
@keyup.enter="onclick"
>
{{ oc.title }}
</a>
</h4>
<occurence :ed="ed" :oc="oc" />
</li>
</ul>
</li>
@@ -43,8 +33,13 @@
</template>
<script>
import Occurence from './Occurence'
export default {
name: 'IndexItemOcurrences',
components: {
Occurence
},
props: {
content: Object
},
@@ -56,25 +51,6 @@ export default {
// not necesseary anymore (KB #758)
console.log('Array.isArray(oc)', Array.isArray(oc))
return Array.isArray(oc) ? oc : [oc]
},
onclick (e) {
console.log('clicked on text occurence', e)
if (e.target.getAttribute('eduuid')) {
this.$router.push({
name: `editiontext`,
params: {
id: e.target.getAttribute('eduuid'),
textid: e.target.getAttribute('uuid')
}
})
} else {
this.$router.push({
name: `edition`,
params: {
id: e.target.getAttribute('uuid')
}
})
}
}
}
}