Skip to content

Commit

Permalink
1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
optimalisatie committed Feb 12, 2020
1 parent 39df63d commit ff8a861
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "styletools/lazy",
"version": "1.1.3",
"version": "1.1.4",
"description": "A lightweight lazy loader based on `window.IntersectionObserver` with tiny fallback for old browsers.",
"keywords": ["lazy",
"images",
Expand Down
8 changes: 4 additions & 4 deletions dist/lazy+data-attr+polyfill+events.js

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

10 changes: 5 additions & 5 deletions dist/lazy+webp+data-attr+polyfill+events.js

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": "@style.tools/lazy",
"version": "1.1.3",
"version": "1.1.4",
"description": "A lightweight lazy image and iframe loader based on `window.IntersectionObserver` with tiny fallback for old browsers.",
"author": {
"name": "info@style.tools",
Expand Down
12 changes: 12 additions & 0 deletions src/lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ function GET_DATA_ATTR(el, attr) {
return el.getAttribute('data-' + attr);
}

function REMOVE_DATA_ATTR(el, attr) {
return el.removeAttribute('data-' + attr);
}

// query
function QUERY(selector) {
return doc.querySelectorAll(selector);
Expand Down Expand Up @@ -76,6 +80,10 @@ function $lazy(config, inview, observer_callback) {
}
}
target[SRCSET] = srcset;

if (CLICK_EXTENSION) {
REMOVE_DATA_ATTR(target, SRCSET);
}
}

if ( src ) {
Expand All @@ -86,6 +94,10 @@ function $lazy(config, inview, observer_callback) {
}
}
target[SRC] = src;

if (CLICK_EXTENSION) {
REMOVE_DATA_ATTR(target, SRC);
}
}

// hook for sending a custom event etc.
Expand Down

0 comments on commit ff8a861

Please sign in to comment.