Skip to content

Commit

Permalink
Remove jQuery .attr from the image diff (#29917)
Browse files Browse the repository at this point in the history
- Switched from jQuery `.attr` to plain javascript `.setAttribute`
- Tested the image diff functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
  • Loading branch information
yardenshoham authored Mar 19, 2024
1 parent 4cfda02 commit cb98e27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/features/imagediff.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function initImageDiff() {

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

Please sign in to comment.