Loading js/intersection-observer.js +53 −56 Original line number Diff line number Diff line Loading @@ -2,16 +2,12 @@ (function (Drupal, drupalSettings) { let io_initialized = false; let observe = false; Drupal.behaviors.oembedLazyloadIntersectionObserver = { attach: function attach(context) { if (io_initialized) { return; } io_initialized = true; if (observe === false) { // Check for IntersectionObserver support. // @see https://github.com/w3c/IntersectionObserver/blob/7382ce7e834c57ea166081484bd8f8a6de84de04/polyfill/intersection-observer.js#L16 const modern_support = Loading @@ -19,7 +15,7 @@ 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype; const observe = (function () { observe = (function () { if (modern_support) { // Create an intersection observer that swaps out the src attribute. Loading Loading @@ -69,6 +65,7 @@ }; } })(); } // Set the observer to watch each eligible iframe. const videos = context.querySelectorAll('.oembed-lazyload[data-strategy="intersection-observer"]'); Loading Loading
js/intersection-observer.js +53 −56 Original line number Diff line number Diff line Loading @@ -2,16 +2,12 @@ (function (Drupal, drupalSettings) { let io_initialized = false; let observe = false; Drupal.behaviors.oembedLazyloadIntersectionObserver = { attach: function attach(context) { if (io_initialized) { return; } io_initialized = true; if (observe === false) { // Check for IntersectionObserver support. // @see https://github.com/w3c/IntersectionObserver/blob/7382ce7e834c57ea166081484bd8f8a6de84de04/polyfill/intersection-observer.js#L16 const modern_support = Loading @@ -19,7 +15,7 @@ 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype; const observe = (function () { observe = (function () { if (modern_support) { // Create an intersection observer that swaps out the src attribute. Loading Loading @@ -69,6 +65,7 @@ }; } })(); } // Set the observer to watch each eligible iframe. const videos = context.querySelectorAll('.oembed-lazyload[data-strategy="intersection-observer"]'); Loading