FIX: Don't reload already loaded lazy images

This commit is contained in:
Tony Air 2020-06-28 18:07:33 +07:00
parent 1d567ede12
commit 3549acf212
4 changed files with 11 additions and 3 deletions

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

2
dist/js/app.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
"version": "2.2.3",
"version": "2.2.4",
"author": "Tony Air <tony@twma.pro>",
"license": "MIT",
"description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.",

View File

@ -416,6 +416,10 @@ const MainUI = (($) => {
const src = $el.attr('src');
const lazySrc = $el.data('lazy-src');
if ($el.hasClass('loaded')) {
return;
}
if (src && src.length) {
$imgUrls.push(src);
}
@ -442,6 +446,10 @@ const MainUI = (($) => {
const $el = $(el);
const lazySrc = $el.data('lazy-bg');
if ($el.hasClass('loaded')) {
return;
}
if (lazySrc && lazySrc.length) {
$imgLazyUrls.push(lazySrc);
$el.addClass('loading');