1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 11:08:19 +00:00

Prevent duplicate image loading (#25675) (#25684)

Backport #25675 by @delvh

Regression of #25672.

Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
Giteabot
2023-07-04 10:49:39 -04:00
committed by GitHub
parent 491f36d32a
commit 4e310133f9

View File

@@ -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);