Skip to content

Commit

Permalink
Prevent duplicate image loading
Browse files Browse the repository at this point in the history
Regression of go-gitea#25672.
  • Loading branch information
delvh committed Jul 4, 2023
1 parent 9958642 commit b9fca9c
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-is-loaded-image])').each(function() {
const $container = $(this);
$container.attr("data-is-loaded-image","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 b9fca9c

Please sign in to comment.