fixed coollightbox

This commit is contained in:
2022-02-22 13:43:18 +01:00
parent 96b343b246
commit 99384d32c4
12 changed files with 2679 additions and 48 deletions

View File

@ -0,0 +1,51 @@
<template lang="html">
<CoolLightBox
:items="coolLightBoxItems"
:index="coolLightBoxIndex"
srcName="url"
:loop="true"
:fullscreen="true"
@close="setcoolLightBoxIndex(null)">
</CoolLightBox>
</template>
<script>
import { mapState, mapActions } from 'vuex'
// import MA from 'vuejs/api/ma-axios'
import router from 'vuejs/route'
import CoolLightBox from 'vue-cool-lightbox'
import 'vue-cool-lightbox/dist/vue-cool-lightbox.min.css'
export default {
router,
// props:[],
data() {
return {
// isOpened: false
}
},
computed: {
...mapState({
coolLightBoxItems: state => state.Common.coolLightBoxItems,
coolLightBoxIndex: state => state.Common.coolLightBoxIndex,
})
},
beforeMount() {
},
methods: {
...mapActions({
setcoolLightBoxIndex: 'Common/setcoolLightBoxIndex'
}),
},
components: {
CoolLightBox
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -271,23 +271,27 @@
<img
class="blank"
:src="blanksrc"
@click="lightbox_index = index"
@click="setcoolLightBoxIndex(index)"
>
</figure>
</section>
<CoolLightBox
<!-- <CoolLightBox
:items="material.images"
:index="lightbox_index"
srcName="url"
:loop="true"
:fullScreen="true"
@close="lightbox_index = null">
</CoolLightBox>
</CoolLightBox> -->
</article>
</template>
<script>
import { mapState, mapActions } from 'vuex'
// import CoolLightBox from 'vue-cool-lightbox'
// import 'vue-cool-lightbox/dist/vue-cool-lightbox.min.css'
import {
VsaList,
VsaItem,
@ -317,6 +321,7 @@ export default {
mixins: [cardMixins],
components: {
LinkedMaterialCard,
// CoolLightBox,
VsaList,
VsaItem,
VsaHeading,
@ -365,7 +370,9 @@ export default {
...mapState({
csrf_token: state => state.User.csrf_token,
flagcolls: state => state.User.flagcolls,
showrooms: state => state.Showrooms.showrooms_by_tid
showrooms: state => state.Showrooms.showrooms_by_tid,
coolLightBoxItems: state => state.Common.coolLightBoxItems,
coolLightBoxIndex: state => state.Common.coolLightBoxIndex
}),
collsLength() {
return Object.keys(this.flagcolls).length
@ -397,7 +404,9 @@ export default {
...mapActions({
// refreshItem: 'Search/refreshItem',
createFlagColl: 'User/createFlagColl',
flagUnflag: 'User/flagUnflag'
flagUnflag: 'User/flagUnflag',
setcoolLightBoxItems: 'Common/setcoolLightBoxItems',
setcoolLightBoxIndex: 'Common/setcoolLightBoxIndex'
}),
loadMaterial(){
console.log('loadMaterial', this.item.id)
@ -424,6 +433,7 @@ export default {
// setTimeout(function () {
// this.activateLazyLoad()
// }.bind(this), 5)
this.setcoolLightBoxItems(this.material.images)
})
.catch(error => {
console.warn('Issue with loadMaterial', error)