summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-07-04 10:49:39 -0400
committerGitHub <noreply@github.com>2023-07-04 14:49:39 +0000
commit4e310133f95ba8581c121a32596807721bdd6af9 (patch)
treec1c770a8e93230a4befd2ceefd44a0cdc3ef077d /web_src
parent491f36d32ad038fcbc241ceccee4288d5d10e768 (diff)
downloadgitea-4e310133f95ba8581c121a32596807721bdd6af9.tar.gz
gitea-4e310133f95ba8581c121a32596807721bdd6af9.zip
Prevent duplicate image loading (#25675) (#25684)
Backport #25675 by @delvh Regression of #25672. Co-authored-by: delvh <dev.lh@web.de>
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);