From f74d2d79119c8dad6d5a8ca85be48cb6f7e3d681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Tue, 24 Oct 2023 00:10:40 +0200 Subject: [PATCH] Lazyload removed lib removed --- _dev/css/theme/components/_index.scss | 1 - .../css/theme/components/lazyload/_index.scss | 1 - .../theme/components/lazyload/_lazyload.scss | 5 ----- _dev/js/theme/components/Lazyload.js | 21 ------------------- _dev/js/theme/index.js | 5 ----- .../miniatures/_partials/product-thumb.tpl | 5 +++-- .../catalog/_partials/miniatures/brand.tpl | 6 +++--- .../_partials/miniatures/pack-product.tpl | 5 +++-- .../_partials/product-cover-thumbnails.tpl | 21 +++++++++++-------- .../_partials/product-images-modal.tpl | 12 ++++++----- .../_partials/cart-detailed-product-line.tpl | 2 +- .../_partials/cart-summary-product-line.tpl | 2 +- .../_partials/order-details-return-table.tpl | 2 +- .../customer/_partials/product-table-line.tpl | 2 +- 14 files changed, 32 insertions(+), 58 deletions(-) delete mode 100644 _dev/css/theme/components/lazyload/_index.scss delete mode 100644 _dev/css/theme/components/lazyload/_lazyload.scss delete mode 100644 _dev/js/theme/components/Lazyload.js diff --git a/_dev/css/theme/components/_index.scss b/_dev/css/theme/components/_index.scss index 22c276d3..34450a05 100644 --- a/_dev/css/theme/components/_index.scss +++ b/_dev/css/theme/components/_index.scss @@ -9,5 +9,4 @@ @import "search/index"; @import "page-loader/index"; @import "links-list/index"; -@import "lazyload/index"; @import "alert-toast/index"; diff --git a/_dev/css/theme/components/lazyload/_index.scss b/_dev/css/theme/components/lazyload/_index.scss deleted file mode 100644 index 1ce293c7..00000000 --- a/_dev/css/theme/components/lazyload/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import "lazyload"; diff --git a/_dev/css/theme/components/lazyload/_lazyload.scss b/_dev/css/theme/components/lazyload/_lazyload.scss deleted file mode 100644 index 78dc3128..00000000 --- a/_dev/css/theme/components/lazyload/_lazyload.scss +++ /dev/null @@ -1,5 +0,0 @@ -img.lazyload { - &:not(.loaded) { - background: $gray-200; - } -} diff --git a/_dev/js/theme/components/Lazyload.js b/_dev/js/theme/components/Lazyload.js deleted file mode 100644 index 1a0eb120..00000000 --- a/_dev/js/theme/components/Lazyload.js +++ /dev/null @@ -1,21 +0,0 @@ -import LazyLoad from 'vanilla-lazyload'; - -class PageLazyLoad { - constructor({ selector = '.lazyload' } = {}) { - this.selector = selector; - this.lazyLoadInstance = null; - this.init(); - } - - init() { - this.lazyLoadInstance = new LazyLoad({ - elements_selector: this.selector, - }); - } - - update() { - this.lazyLoadInstance.update(); - } -} - -export default PageLazyLoad; diff --git a/_dev/js/theme/index.js b/_dev/js/theme/index.js index 7fd4cece..db020550 100644 --- a/_dev/js/theme/index.js +++ b/_dev/js/theme/index.js @@ -19,15 +19,10 @@ for (const i in EventEmitter.prototype) { } import usePasswordPolicy from './components/password/usePasswordPolicy'; import useThemeForm from './components/useThemeForm'; -import PageLazyLoad from './components/Lazyload'; import httpRequestErrorHandler from './handler/error/httpRequestErrorHandler'; import usePageLoader from "./components/usePageLoader"; import { DOMReady } from "../utils/DOM/DOMHelpers"; -prestashop.pageLazyLoad = new PageLazyLoad({ - selector: '.lazyload', -}); - prestashop.pageLoader = usePageLoader(); prestashop.on('handleError', httpRequestErrorHandler); diff --git a/templates/catalog/_partials/miniatures/_partials/product-thumb.tpl b/templates/catalog/_partials/miniatures/_partials/product-thumb.tpl index a02cea53..03c60784 100644 --- a/templates/catalog/_partials/miniatures/_partials/product-thumb.tpl +++ b/templates/catalog/_partials/miniatures/_partials/product-thumb.tpl @@ -5,7 +5,7 @@ {if !empty($product.default_image.legend)}{$product.default_image.legend}{else}{$product.name|truncate:30:'...'}{/if} {/images_block} diff --git a/templates/catalog/_partials/miniatures/brand.tpl b/templates/catalog/_partials/miniatures/brand.tpl index 1038a4a2..17b9d9f2 100644 --- a/templates/catalog/_partials/miniatures/brand.tpl +++ b/templates/catalog/_partials/miniatures/brand.tpl @@ -27,12 +27,12 @@
{$sizes = Image::getSize('home_default')} {$brand.name}

diff --git a/templates/catalog/_partials/miniatures/pack-product.tpl b/templates/catalog/_partials/miniatures/pack-product.tpl index 8c2e7b7a..fa17b280 100644 --- a/templates/catalog/_partials/miniatures/pack-product.tpl +++ b/templates/catalog/_partials/miniatures/pack-product.tpl @@ -29,8 +29,9 @@ {images_block webpEnabled=$webpEnabled}