Skip to content

Commit

Permalink
Prevent duplicate image loading (#25675)
Browse files Browse the repository at this point in the history
Regression of #25672.
  • Loading branch information
delvh committed Jul 4, 2023
1 parent 43c9a84 commit f4c1f43
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 f4c1f43

Please sign in to comment.