fixed modalcard lazy load
This commit is contained in:
parent
d9a415e04d
commit
fda78eea9d
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -131,6 +131,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeMount () {
|
||||||
|
console.log(this.item.id, this.samples)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
// refreshItem: 'Search/refreshItem',
|
// refreshItem: 'Search/refreshItem',
|
||||||
|
|
|
@ -421,9 +421,9 @@ export default {
|
||||||
}
|
}
|
||||||
// delay the lazyload to let the card the time to update dom
|
// delay the lazyload to let the card the time to update dom
|
||||||
// maybe not the best method
|
// maybe not the best method
|
||||||
setTimeout(function () {
|
// setTimeout(function () {
|
||||||
this.activateLazyLoad()
|
// this.activateLazyLoad()
|
||||||
}.bind(this), 5)
|
// }.bind(this), 5)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn('Issue with loadMaterial', error)
|
console.warn('Issue with loadMaterial', error)
|
||||||
|
|
|
@ -3,7 +3,7 @@ export default {
|
||||||
directives: {
|
directives: {
|
||||||
lazy: {
|
lazy: {
|
||||||
bind (figure, binding) {
|
bind (figure, binding) {
|
||||||
// console.log('lazy bind', figure, binding)
|
console.log('directive lazy bind', figure, binding)
|
||||||
// show only the first image
|
// show only the first image
|
||||||
if (binding.value === 0) {
|
if (binding.value === 0) {
|
||||||
const img = figure.querySelector('img:not(.blank)')
|
const img = figure.querySelector('img:not(.blank)')
|
||||||
|
@ -52,7 +52,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
updated () {
|
||||||
// lazy load images on mouseover
|
// lazy load images on mouseover
|
||||||
console.log('card mounted', this.$options.name)
|
console.log('card mounted', this.$options.name)
|
||||||
// if (this.$options.name ==! 'ModalCard') {
|
// if (this.$options.name ==! 'ModalCard') {
|
||||||
|
@ -89,7 +89,7 @@ export default {
|
||||||
}
|
}
|
||||||
// ,
|
// ,
|
||||||
// methods: {
|
// methods: {
|
||||||
// // not used
|
// // used by ModalCard
|
||||||
// activateLazyLoad () {
|
// activateLazyLoad () {
|
||||||
// console.log('card activateLazyLoad', this.$options.name)
|
// console.log('card activateLazyLoad', this.$options.name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue