Replace queryClosestParent with Element.prototype.closest

This commit is contained in:
Deven Caron
2021-10-19 14:46:38 -04:00
parent df567220d5
commit 082f3b5827

View File

@@ -1,5 +1,3 @@
import { queryClosestParent } from './html';
const LAZY_LOADED_IMAGES = []
export function loadImage(url, options = {}) {
@@ -75,7 +73,7 @@ export async function lazyLoadImage($el, url, callback) {
}
requestAnimationFrame(() => {
let lazyParent = queryClosestParent($el, '.c-lazy')
let lazyParent = $el.closest('.c-lazy');
if(lazyParent) {
lazyParent.classList.add('-lazy-loaded')