aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authordelvh <dev.lh@web.de>2023-07-04 16:43:02 +0200
committerGitHub <noreply@github.com>2023-07-04 14:43:02 +0000
commitf4c1f43644eb4a30d185518c1732b24aa821e39d (patch)
tree8c8d21cc7125bd1600704a2334d24dbe1bc94209 /web_src
parent43c9a84ae56d33048cb66497d79ca0bed739d115 (diff)
downloadgitea-f4c1f43644eb4a30d185518c1732b24aa821e39d.tar.gz
gitea-f4c1f43644eb4a30d185518c1732b24aa821e39d.zip
Prevent duplicate image loading (#25675)
Regression of #25672.
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/imagediff.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js
index a26b927c33..2e7baab79f 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);