Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions core/pages/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default {
},
offlineImage () {
return {
src: this.getThumbnail(this.product.image, 570, 569),
src: this.getThumbnail(this.product.image, 310, 300),
error: this.getThumbnail(this.product.image, 310, 300),
loading: this.getThumbnail(this.product.image, 310, 300)
}
Expand All @@ -165,7 +165,8 @@ export default {
for (let mediaItem of this.product.media_gallery) {
if (mediaItem.image) {
images.push({
'path': this.getThumbnail(mediaItem.image, 600, 744)
'src': this.getThumbnail(mediaItem.image, 600, 744),
'loading': this.getThumbnail(this.product.image, 310, 300)
})
}
}
Expand All @@ -178,14 +179,16 @@ export default {
Object.keys(grupedByAttribute).forEach((confChild) => {
if (grupedByAttribute[confChild][0].image) {
images.push({
'path': this.getThumbnail(grupedByAttribute[confChild][0].image, 600, 744),
'src': this.getThumbnail(grupedByAttribute[confChild][0].image, 600, 744),
'loading': this.getThumbnail(this.product.image, 310, 300),
'id': confChild
})
}
})
} else {
images.push({
'path': this.getThumbnail(this.product.image, 600, 744)
'src': this.getThumbnail(this.product.image, 600, 744),
'loading': this.getThumbnail(this.product.image, 310, 300)
})
}
return images
Expand Down
26 changes: 12 additions & 14 deletions src/themes/default/components/core/ProductGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
</div>
<i v-if="isZoomOpen" v-show="OnlineOnly" class="material-icons modal-close p15 cl-bg-tertiary pointer" @click="toggleZoom">close</i>
<div v-show="OnlineOnly" :class="{ 'container product-zoom py40': isZoomOpen }">
<div v-if="loaded" :class="{ row: isZoomOpen }">
<div :class="{ row: isZoomOpen }">
<div class="scroll col-md-2 p0" v-if="isZoomOpen">
<div class="thumbnails">
<div
class="bg-cl-secondary"
v-for="(images, key) in gallery"
:key="key">
<transition name="fade" appear>
<img v-lazy="images.path" class="mw-100 pointer" ref="images.path" @click="navigate(key)">
<img v-lazy="images" class="mw-100 pointer" ref="images" @click="navigate(key)">
</transition>
</div>
</div>
</div>
<div v-if="gallery.length === 1">
<transition name="fade" appear>
<img v-lazy="gallery[0].path" class="mw-100 pointer" ref="gallery[0].path">
<img v-lazy="gallery[0].src" class="mw-100 pointer" ref="gallery[0].src">
</transition>
</div>
<div v-else :class="{ 'col-md-10' : isZoomOpen}">
Expand All @@ -42,8 +42,8 @@
<div class="bg-cl-secondary">
<img
class="product-image inline-flex pointer mw-100"
v-lazy="images.path"
ref="images.path"
v-lazy="images"
ref="images"
@dblclick="toggleZoom">
</div>
</slide>
Expand All @@ -69,21 +69,14 @@ export default {
return {
loaded: true
}
},
methods: {
isLoaded () {
this.loaded = true
}
},
created () {
this.$Lazyload.$on('loaded', this.isLoaded)
}
}
</script>

<style lang="scss" scoped>
.media-gallery {
text-align: center;
height: 100%;
&.open {
z-index: 3;
top: 0;
Expand Down Expand Up @@ -121,7 +114,12 @@ img {
opacity: 1;
}
}

img[lazy=error] {
width: 100%;
}
img[lazy=loading] {
width: 100%;
}
.scroll {
height: 747px;
overflow: auto;
Expand Down