Skip to content

Commit

Permalink
Prevent duplicate image loading (go-gitea#25675) (go-gitea#25684)
Browse files Browse the repository at this point in the history
Backport go-gitea#25675 by @delvh

Regression of go-gitea#25672.

Co-authored-by: delvh <dev.lh@web.de>
  • Loading branch information
GiteaBot and delvh authored Jul 4, 2023
1 parent 491f36d commit 4e31013
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web_src/js/features/imagediff.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4e31013

Please sign in to comment.