Skip to content

Commit

Permalink
Lazyload removed lib removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksydan committed Oct 23, 2023
1 parent bdfbe4d commit f74d2d7
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 58 deletions.
1 change: 0 additions & 1 deletion _dev/css/theme/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
@import "search/index";
@import "page-loader/index";
@import "links-list/index";
@import "lazyload/index";
@import "alert-toast/index";
1 change: 0 additions & 1 deletion _dev/css/theme/components/lazyload/_index.scss

This file was deleted.

5 changes: 0 additions & 5 deletions _dev/css/theme/components/lazyload/_lazyload.scss

This file was deleted.

21 changes: 0 additions & 21 deletions _dev/js/theme/components/Lazyload.js

This file was deleted.

5 changes: 0 additions & 5 deletions _dev/js/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img
{if $product.default_image}
data-full-size-image-url="{$product.default_image.large.url}"
{generateImagesSources image=$product.default_image size='home_default' lazyload=true}
{generateImagesSources image=$product.default_image size='home_default'}
alt="{if !empty($product.default_image.legend)}{$product.default_image.legend}{else}{$product.name|truncate:30:'...'}{/if}"
width="{$product.default_image.bySize.home_default.width}"
height="{$product.default_image.bySize.home_default.height}"
Expand All @@ -15,7 +15,8 @@
width="{$urls.no_picture_image.bySize.home_default.width}"
height="{$urls.no_picture_image.bySize.home_default.height}"
{/if}
class="img-fluid rounded lazyload"
class="img-fluid rounded"
loading="lazy"
/>
{/images_block}

Expand Down
6 changes: 3 additions & 3 deletions templates/catalog/_partials/miniatures/brand.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<div class="card h-100">
{$sizes = Image::getSize('home_default')}
<img
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='{$sizes.width}' height='{$sizes.height}' viewBox='0 0 1 1'%3E%3C/svg%3E"
data-src="{$brand.image|replace:'small_default':'home_default'}"
src="{$brand.image|replace:'small_default':'home_default'}"
alt="{$brand.name}"
class="card-img-top lazyload"
class="card-img-top"
width="{$sizes.width}"
height="{$sizes.height}"
loading="lazy"
>
<div class="card-body">
<p class="h6 mb-0">
Expand Down
5 changes: 3 additions & 2 deletions templates/catalog/_partials/miniatures/pack-product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
<a href="{$product.url}" title="{$product.name}">
{images_block webpEnabled=$webpEnabled}
<img
class="img-fluid lazyload"
{generateImagesSources image=$product.default_image size='cart_default' lazyload=true}
class="img-fluid"
loading="lazy"
{generateImagesSources image=$product.default_image size='cart_default'}
width="{$product.default_image.bySize.cart_default.width}"
height="{$product.default_image.bySize.cart_default.height}"
{if !empty($product.default_image.legend)}
Expand Down
21 changes: 12 additions & 9 deletions templates/catalog/_partials/product-cover-thumbnails.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{if $product.default_image}
<img
class="rounded img-fluid"
{generateImagesSources image=$product.default_image size='large_default' lazyload=false}
{generateImagesSources image=$product.default_image size='large_default'}
width="{$product.default_image.bySize.large_default.width}"
height="{$product.default_image.bySize.large_default.height}"
{if !empty($product.default_image.legend)}
Expand Down Expand Up @@ -63,7 +63,7 @@
<div class="swiper-slide">
<img
class="rounded img-fluid"
{generateImagesSources image=$product.default_image size='large_default' lazyload=false}
{generateImagesSources image=$product.default_image size='large_default'}
width="{$product.default_image.bySize.large_default.width}"
height="{$product.default_image.bySize.large_default.height}"
{if !empty($product.default_image.legend)}
Expand All @@ -83,8 +83,9 @@

<div class="swiper-slide" data-index="{$index}">
<img
class="rounded img-fluid lazyload"
{generateImagesSources image=$image size='large_default' lazyload=true}
class="rounded img-fluid"
loading="lazy"
{generateImagesSources image=$image size='large_default' }
width="{$image.bySize.large_default.width}"
height="{$image.bySize.large_default.height}"
{if !empty($product.default_image.legend)}
Expand Down Expand Up @@ -112,7 +113,7 @@
{images_block webpEnabled=$webpEnabled}
<img
class="rounded img-fluid"
{generateImagesSources image=$product.default_image size='large_default' lazyload=false}
{generateImagesSources image=$product.default_image size='large_default'}
width="{$product.default_image.bySize.large_default.width}"
height="{$product.default_image.bySize.large_default.height}"
{if !empty($product.default_image.legend)}
Expand Down Expand Up @@ -141,8 +142,9 @@
<div class="product-thumbs__list swiper-wrapper">
<div class="product-thumbs__elem swiper-slide">
<img
class="rounded img-fluid lazyload"
{generateImagesSources image=$product.default_image size='home_default' lazyload=true}
class="rounded img-fluid"
loading="lazy"
{generateImagesSources image=$product.default_image size='home_default'}
width="{$product.default_image.bySize.home_default.width}"
height="{$product.default_image.bySize.home_default.height}"
{if !empty($product.default_image.legend)}
Expand All @@ -160,8 +162,9 @@
{/if}
<div class="product-thumbs__elem swiper-slide">
<img
class="rounded img-fluid lazyload"
{generateImagesSources image=$image size='home_default' lazyload=true}
class="rounded img-fluid"
loading="lazy"
{generateImagesSources image=$image size='home_default'}
width="{$image.bySize.home_default.width}"
height="{$image.bySize.home_default.height}"
{if !empty($product.default_image.legend)}
Expand Down
12 changes: 7 additions & 5 deletions templates/catalog/_partials/product-images-modal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
<div class="modal-gallery__list swiper-wrapper">
<div class="swiper-slide modal-gallery__elem">
<img
class="rounded img-fluid lazyload"
{generateImagesSources image=$product.default_image size='large_default' lazyload=false}
class="rounded img-fluid"
{generateImagesSources image=$product.default_image size='large_default'}
width="{$product.default_image.bySize.large_default.width}"
height="{$product.default_image.bySize.large_default.height}"
loading="lazy"
{if !empty($product.default_image.legend)}
alt="{$product.default_image.legend}"
title="{$product.default_image.legend}"
Expand All @@ -53,10 +54,11 @@

<div class="swiper-slide modal-gallery__elem">
<img
class="rounded img-fluid lazyload"
{generateImagesSources image=$image size='large_default' lazyload=true}
class="rounded img-fluid"
{generateImagesSources image=$image size='large_default'}
width="{$image.bySize.large_default.width}"
height="{$image.bySize.large_default.height}"
loading="lazy"
{if !empty($product.default_image.legend)}
alt="{$image.legend}" title="{$image.legend}"
{else}
Expand All @@ -74,7 +76,7 @@
{images_block webpEnabled=$webpEnabled}
<img
class="rounded img-fluid"
{generateImagesSources image=$product.default_image size='large_default' lazyload=false}
{generateImagesSources image=$product.default_image size='large_default'}
width="{$product.default_image.bySize.large_default.width}"
height="{$product.default_image.bySize.large_default.height}"
{if !empty($product.default_image.legend)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="product-line-grid__block product-line-grid__block--image">
{images_block webpEnabled=$webpEnabled}
<img
{generateImagesSources image=$product.default_image size='cart_default' lazyload=false}
{generateImagesSources image=$product.default_image size='cart_default'}
alt="{$product.name|escape:'quotes'}"
class="img-fluid rounded"
width="{$product.default_image.bySize.cart_default.width}"
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/_partials/cart-summary-product-line.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{images_block webpEnabled=$webpEnabled}
<img
{if $product.default_image}
{generateImagesSources image=$product.default_image size='cart_default' lazyload=false}
{generateImagesSources image=$product.default_image size='cart_default'}
{else}
src="{$urls.no_picture_image.bySize.cart_default.url}"
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{images_block webpEnabled=$webpEnabled}
{if $product.default_image}
<img
{generateImagesSources image=$product.cover size='cart_default' lazyload=false}
{generateImagesSources image=$product.cover size='cart_default'}
alt="{$product.name|escape:'quotes'}"
class="product-line__img rounded img-fluid"
width="{$product.cover.bySize.cart_default.width}"
Expand Down
2 changes: 1 addition & 1 deletion templates/customer/_partials/product-table-line.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{images_block webpEnabled=$webpEnabled}
{if $product.default_image}
<img
{generateImagesSources image=$product.default_image size='cart_default' lazyload=false}
{generateImagesSources image=$product.default_image size='cart_default'}
alt="{$product.name|escape:'quotes'}"
class="product-line__img rounded img-fluid"
width="{$product.default_image.bySize.cart_default.width}"
Expand Down

0 comments on commit f74d2d7

Please sign in to comment.