Skip to content

Commit

Permalink
Bug Fix: Change the application order of src and srcset to suppre…
Browse files Browse the repository at this point in the history
…ss the `NS_BINDING_ABORTED` notice(#632).
  • Loading branch information
NaotoshiFujita committed Jan 26, 2022
1 parent 0201f9d commit 5e0c2ac
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/js/splide-renderer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/js/splide.cjs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Splide.js
* Version : 3.6.11
* Version : 3.6.12
* License : MIT
* Copyright: 2022 Naotoshi Fujita
*/
Expand Down Expand Up @@ -2037,7 +2037,7 @@ function LazyLoad(Splide2, Components2, options) {
bind(_img, "load error", (e) => {
onLoad(data, e.type === "error");
});
["src", "srcset"].forEach((name) => {
["srcset", "src"].forEach((name) => {
if (data[name]) {
setAttribute(_img, name, data[name]);
removeAttribute(_img, name === "src" ? SRC_DATA_ATTRIBUTE : SRCSET_DATA_ATTRIBUTE);
Expand Down
4 changes: 2 additions & 2 deletions dist/js/splide.esm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Splide.js
* Version : 3.6.11
* Version : 3.6.12
* License : MIT
* Copyright: 2022 Naotoshi Fujita
*/
Expand Down Expand Up @@ -2033,7 +2033,7 @@ function LazyLoad(Splide2, Components2, options) {
bind(_img, "load error", (e) => {
onLoad(data, e.type === "error");
});
["src", "srcset"].forEach((name) => {
["srcset", "src"].forEach((name) => {
if (data[name]) {
setAttribute(_img, name, data[name]);
removeAttribute(_img, name === "src" ? SRC_DATA_ATTRIBUTE : SRCSET_DATA_ATTRIBUTE);
Expand Down
4 changes: 2 additions & 2 deletions dist/js/splide.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/splide.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/splide.min.js

Large diffs are not rendered by default.

Binary file modified dist/js/splide.min.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splidejs/splide",
"version": "3.6.11",
"version": "3.6.12",
"description": "Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.",
"author": "Naotoshi Fujita",
"license": "MIT",
Expand Down
8 changes: 5 additions & 3 deletions src/js/components/LazyLoad/LazyLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import {
EVENT_MOUNTED,
EVENT_MOVED,
EVENT_REFRESH,
EVENT_RESIZE, EVENT_SCROLLED,
EVENT_RESIZE,
EVENT_SCROLLED,
} from '../../constants/events';
import { EventInterface } from '../../constructors';
import { Splide } from '../../core/Splide/Splide';
import { BaseComponent, Components, Options } from '../../types';
import {
addClass, child,
addClass,
child,
create,
display,
getAttribute,
Expand Down Expand Up @@ -158,7 +160,7 @@ export function LazyLoad( Splide: Splide, Components: Components, options: Optio
addClass( data._Slide.slide, CLASS_LOADING );
bind( _img, 'load error', e => { onLoad( data, e.type === 'error' ) } );

[ 'src', 'srcset' ].forEach( name => {
[ 'srcset', 'src' ].forEach( name => {
if ( data[ name ] ) {
setAttribute( _img, name, data[ name ] );
removeAttribute( _img, name === 'src' ? SRC_DATA_ATTRIBUTE : SRCSET_DATA_ATTRIBUTE );
Expand Down

0 comments on commit 5e0c2ac

Please sign in to comment.