FIX: Lazy load ready state

This commit is contained in:
Tony Air 2020-06-28 18:54:31 +07:00
parent 3549acf212
commit 7fe2ae2e3a
4 changed files with 9 additions and 6 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.4",
"version": "2.2.5",
"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

@ -430,10 +430,13 @@ const MainUI = (($) => {
AjaxUI.preload([lazySrc]).then(() => {
$el.attr('src', lazySrc);
$el.addClass('loaded');
$el.removeClass('loading');
$el.on('load', () => {
$el.addClass('loaded');
$el.removeClass('loading');
$el.trigger(`${Events.LAZYIMAGEREADY}`);
});
$el.trigger(`${Events.LAZYIMAGEREADY}`);
});
}
});