From ed2ad57dcaf83f7aa7211c7558dd6da61e9d1ebd Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 25 Oct 2020 08:05:26 -0400 Subject: [PATCH] Ensure no-large-element styling is removed --- src/js/scriptlets/load-large-media-interactive.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/scriptlets/load-large-media-interactive.js b/src/js/scriptlets/load-large-media-interactive.js index 64194edfd..2af43502b 100644 --- a/src/js/scriptlets/load-large-media-interactive.js +++ b/src/js/scriptlets/load-large-media-interactive.js @@ -157,7 +157,6 @@ const loadImage = async function(elem) { const loadMany = function(elems) { for ( const elem of elems ) { - elem.removeAttribute(largeMediaElementAttribute); switch ( elem.localName ) { case 'audio': case 'video': @@ -183,6 +182,7 @@ const onMouseClick = function(ev) { : [ ev.target ]; for ( const elem of elems ) { if ( elem.matches(largeMediaElementSelector) === false ) { continue; } + elem.removeAttribute(largeMediaElementAttribute); if ( mediaNotLoaded(elem) ) { toLoad.push(elem); } @@ -244,6 +244,7 @@ vAPI.loadAllLargeMedia = function() { const toLoad = []; for ( const elem of document.querySelectorAll(largeMediaElementSelector) ) { + elem.removeAttribute(largeMediaElementAttribute); if ( mediaNotLoaded(elem) ) { toLoad.push(elem); }