Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicate image loading #25675

Merged
merged 5 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename data-is-loaded-image -> data-is-image-loaded
delvh committed Jul 4, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 08b8bf17dca8a94914d7e081852a6aa612f80449
4 changes: 2 additions & 2 deletions web_src/js/features/imagediff.js
Original file line number Diff line number Diff line change
@@ -65,9 +65,9 @@ export function initImageDiff() {
};
}

$('.image-diff:not([data-is-loaded-image])').each(function() {
$('.image-diff:not([data-is-image-loaded])').each(function() {
const $container = $(this);
$container.attr('data-is-loaded-image', 'true');
$container.attr('data-is-image-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);