Comparing version 3.1.3 to 3.1.4
@@ -72,3 +72,3 @@ 'use strict'; | ||
win["requestAnimationFrame"](() => { | ||
element[dataAttr] = element.dataset[dataAttr]; | ||
element.setAttribute(dataAttr, element.dataset[dataAttr]); | ||
}); | ||
@@ -75,0 +75,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var yall=function(){"use strict";return function(e){var n=(e=e||{}).lazyClass||"lazy",t=e.lazyBackgroundClass||"lazy-bg",o="idleLoadTimeout"in e?e.idleLoadTimeout:200,i=e.observeChanges||!1,r=e.events||{},a=window,s="requestIdleCallback",c="IntersectionObserver",u=["srcset","src","poster"],d=[],l=function(e,o){return d.slice.call((o||document).querySelectorAll(e||"img."+n+",video."+n+",iframe."+n+",."+t))},f=function(n){var o,i,r=n.parentNode;for(var a in"PICTURE"==r.nodeName&&(i=r),"VIDEO"==n.nodeName&&(i=n),o=l("source",i))b(o[a]);b(n),n.autoplay&&n.load();var s=n.classList;s.contains(t)&&(s.remove(t),s.add(e.lazyBackgroundLoaded||"lazy-bg-loaded"))},v=function(e){for(var n in r)e.addEventListener(n,r[n].listener||r[n],r[n].options||void 0);h.observe(e)},b=function(e){u.forEach(function(n){n in e.dataset&&a.requestAnimationFrame(function(){e[n]=e.dataset[n]})})},g=l();if(/baidu|(?:google|bing|yandex|duckduck)bot/i.test(navigator.userAgent))for(var m in g)f(g[m]);else if(c in a&&c+"Entry"in a){var h=new a[c](function(e,t){e.forEach(function(e){if(e.isIntersecting||e.intersectionRatio){var r=e.target;s in a&&o?a[s](function(){f(r)},{timeout:o}):f(r),r.classList.remove(n),t.unobserve(r),(g=g.filter(function(e){return e!=r})).length||i||h.disconnect()}})},{rootMargin:("threshold"in e?e.threshold:200)+"px 0%"});for(var y in g)v(g[y]);i&&new MutationObserver(function(){l().forEach(function(e){g.indexOf(e)<0&&(g.push(e),v(e))})}).observe(l(e.observeRootSelector||"body")[0],e.mutationObserverOptions||{childList:!0,subtree:!0})}}}(); | ||
var yall=function(){"use strict";return function(e){var n=(e=e||{}).lazyClass||"lazy",t=e.lazyBackgroundClass||"lazy-bg",o="idleLoadTimeout"in e?e.idleLoadTimeout:200,i=e.observeChanges||!1,r=e.events||{},a=window,s="requestIdleCallback",c="IntersectionObserver",u=["srcset","src","poster"],d=[],l=function(e,o){return d.slice.call((o||document).querySelectorAll(e||"img."+n+",video."+n+",iframe."+n+",."+t))},f=function(n){var o,i,r=n.parentNode;for(var a in"PICTURE"==r.nodeName&&(i=r),"VIDEO"==n.nodeName&&(i=n),o=l("source",i))b(o[a]);b(n),n.autoplay&&n.load();var s=n.classList;s.contains(t)&&(s.remove(t),s.add(e.lazyBackgroundLoaded||"lazy-bg-loaded"))},v=function(e){for(var n in r)e.addEventListener(n,r[n].listener||r[n],r[n].options||void 0);h.observe(e)},b=function(e){u.forEach(function(n){n in e.dataset&&a.requestAnimationFrame(function(){e.setAttribute(n,e.dataset[n])})})},g=l();if(/baidu|(?:google|bing|yandex|duckduck)bot/i.test(navigator.userAgent))for(var m in g)f(g[m]);else if(c in a&&c+"Entry"in a){var h=new a[c](function(e,t){e.forEach(function(e){if(e.isIntersecting||e.intersectionRatio){var r=e.target;s in a&&o?a[s](function(){f(r)},{timeout:o}):f(r),r.classList.remove(n),t.unobserve(r),(g=g.filter(function(e){return e!=r})).length||i||h.disconnect()}})},{rootMargin:("threshold"in e?e.threshold:200)+"px 0%"});for(var y in g)v(g[y]);i&&new MutationObserver(function(){l().forEach(function(e){g.indexOf(e)<0&&(g.push(e),v(e))})}).observe(l(e.observeRootSelector||"body")[0],e.mutationObserverOptions||{childList:!0,subtree:!0})}}}(); |
{ | ||
"name": "yall-js", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "Yet Another Lazy Loader", | ||
@@ -9,7 +9,8 @@ "main": "./dist/yall.js", | ||
"scripts": { | ||
"clean": "npx rimraf ./dist", | ||
"clean": "rm -rf ./dist", | ||
"lint": "npx eslint ./src/yall.mjs", | ||
"test": "npm run lint && npm run build && cp -fv ./dist/yall.min.js ./test/js && npm run server", | ||
"server": "node http.js", | ||
"build": "npm run clean && npx rollup -c" | ||
"build": "npm run clean && npx rollup -c", | ||
"postinstall": "npm run build" | ||
}, | ||
@@ -47,3 +48,2 @@ "repository": { | ||
"express": "^4.17.1", | ||
"rimraf": "^2.6.3", | ||
"rollup": "^1.17.0", | ||
@@ -50,0 +50,0 @@ "rollup-plugin-babel": "^4.3.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32128
8
1