Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Franzke committed Apr 17, 2020
2 parents 27cc3c7 + a21b7d5 commit 587797c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions loading-attribute-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Use an IntersectionObserver polyfill in case of IE11 support necessary.
*/

(function(noscriptClass, rootMargin) {
(function (noscriptClass, rootMargin) {
'use strict';

var config = {
Expand Down Expand Up @@ -52,7 +52,7 @@
if ('requestAnimationFrame' in window) {
rAFWrapper = window.requestAnimationFrame;
} else {
rAFWrapper = function(func) {
rAFWrapper = function (func) {
func();
};
}
Expand All @@ -76,7 +76,7 @@
srcsetItems.push(lazyItem);

// Not using .dataset within those upfollowing lines of code for polyfill independent compatibility down to IE9
srcsetItems.forEach(function(item) {
srcsetItems.forEach(function (item) {
if (item.hasAttribute('data-lazy-srcset')) {
item.setAttribute('srcset', item.getAttribute('data-lazy-srcset'));
item.removeAttribute('data-lazy-srcset'); // Not using delete .dataset here for compatibility down to IE9
Expand Down Expand Up @@ -107,7 +107,7 @@
* @param {Object} observer IntersectionObserver instance reference
*/
function onIntersection(entries, observer) {
entries.forEach(function(entry) {
entries.forEach(function (entry) {
// Mitigation for EDGE lacking support of .isIntersecting until v15, compare to e.g. https://github.com/w3c/IntersectionObserver/issues/211#issuecomment-309144669
if (entry.intersectionRatio === 0) {
return;
Expand All @@ -132,7 +132,7 @@

var mediaQueryList = window.matchMedia('print');

mediaQueryList.addListener(function(mql) {
mediaQueryList.addListener(function (mql) {
if (mql.matches) {
document
.querySelectorAll(
Expand All @@ -141,7 +141,7 @@
config.lazyIframe +
'[data-lazy-src]'
)
.forEach(function(lazyItem) {
.forEach(function (lazyItem) {
restoreSource(lazyItem);
});
}
Expand Down Expand Up @@ -250,11 +250,11 @@
if (/comp|inter/.test(document.readyState)) {
rAFWrapper(prepareElements);
} else if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
rAFWrapper(prepareElements);
});
} else {
document.attachEvent('onreadystatechange', function() {
document.attachEvent('onreadystatechange', function () {
if (document.readyState === 'complete') {
prepareElements();
}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@wdio/cli": "^6.0.13",
"@wdio/dot-reporter": "^6.0.12",
"@wdio/local-runner": "^6.0.13",
"@wdio/cli": "^6.0.14",
"@wdio/dot-reporter": "^6.0.14",
"@wdio/local-runner": "^6.0.14",
"@wdio/mocha-framework": "^6.0.13",
"@wdio/sync": "^6.0.12",
"@wdio/sync": "^6.0.14",
"husky": "^4.2.3",
"prettier": "2.0.4",
"pretty-quick": "^2.0.1",
"webdriverio": "^6.0.13",
"webdriverio": "^6.0.14",
"xo": "^0.28.3"
},
"scripts": {
Expand Down

0 comments on commit 587797c

Please sign in to comment.