1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00

Prevent duplicate image loading (#25675)

Regression of #25672.
This commit is contained in:
delvh 2023-07-04 16:43:02 +02:00 committed by GitHub
parent 43c9a84ae5
commit f4c1f43644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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