Skip to content

Commit 883a783

Browse files
delvhGiteaBot
authored andcommitted
Prevent duplicate image loading (go-gitea#25675)
Regression of go-gitea#25672.
1 parent 491f36d commit 883a783

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web_src/js/features/imagediff.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ export function initImageDiff() {
6565
};
6666
}
6767

68-
$('.image-diff').each(function() {
68+
$('.image-diff:not([data-image-diff-loaded])').each(function() {
6969
const $container = $(this);
70+
$container.attr('data-image-diff-loaded', 'true');
7071

7172
// the container may be hidden by "viewed" checkbox, so use the parent's width for reference
7273
const diffContainerWidth = Math.max($container.closest('.diff-file-box').width() - 300, 100);

0 commit comments

Comments
 (0)