FIX: Don't reload already loaded lazy images
This commit is contained in:
parent
1d567ede12
commit
3549acf212
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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.",
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue