From f4c1f43644eb4a30d185518c1732b24aa821e39d Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 4 Jul 2023 16:43:02 +0200 Subject: [PATCH] Prevent duplicate image loading (#25675) Regression of #25672. --- web_src/js/features/imagediff.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index a26b927c33de6..2e7baab79ff99 100644 --- a/web_src/js/features/imagediff.js +++ b/web_src/js/features/imagediff.js @@ -65,8 +65,9 @@ export function initImageDiff() { }; } - $('.image-diff').each(function() { + $('.image-diff:not([data-image-diff-loaded])').each(function() { const $container = $(this); + $container.attr('data-image-diff-loaded', 'true'); // the container may be hidden by "viewed" checkbox, so use the parent's width for reference const diffContainerWidth = Math.max($container.closest('.diff-file-box').width() - 300, 100);