Skip to content

Commit

Permalink
Prevent duplicate image loading (go-gitea#25675)
Browse files Browse the repository at this point in the history
Regression of go-gitea#25672.
  • Loading branch information
delvh authored and GiteaBot committed Jul 4, 2023
1 parent 491f36d commit 883a783
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 883a783

Please sign in to comment.