From 082f3b5827332dfc99de691ee315f6d376bb9a54 Mon Sep 17 00:00:00 2001 From: Deven Caron Date: Tue, 19 Oct 2021 14:46:38 -0400 Subject: [PATCH] Replace queryClosestParent with Element.prototype.closest --- assets/scripts/utils/image.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/assets/scripts/utils/image.js b/assets/scripts/utils/image.js index 2907a049..4e5b29ab 100644 --- a/assets/scripts/utils/image.js +++ b/assets/scripts/utils/image.js @@ -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')