Skip to content

Commit

Permalink
Reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 committed Nov 18, 2024
1 parent e8e42c1 commit 7f9cf0c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions resources/js/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,15 @@ function init() {
this.scrollLock = bool
}
},
resizedPath(imagePath, size, store = config.store) {
let mediaPosition = imagePath.indexOf('/media/')
if (mediaPosition > 0) {
return `/storage/${store}/resizes/${size}/magento` + imagePath.substr(mediaPosition + 6)
resizedPath(imagePath, size, store = null) {
if (!store) {
store = window.config.store
}

let productPosition = imagePath.indexOf('/product/')
if (productPosition > 0) {
return `/storage/${store}/resizes/${size}/magento/catalog` + imagePath.substr(productPosition)
}
let url = new URL(imagePath)
url = url.pathname.replace('/media', '')

return `/storage/${store}/resizes/${size}/magento/catalog/product` + imagePath
return `/storage/${store}/resizes/${size}/magento${url}`
},
},
computed: {
Expand Down

0 comments on commit 7f9cf0c

Please sign in to comment.