Skip to content

Commit cb98e27

Browse files
authored
Remove jQuery .attr from the image diff (#29917)
- Switched from jQuery `.attr` to plain javascript `.setAttribute` - Tested the image diff functionality and it works as before Signed-off-by: Yarden Shoham <[email protected]>
1 parent 4cfda02 commit cb98e27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/features/imagediff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function initImageDiff() {
7070

7171
$('.image-diff:not([data-image-diff-loaded])').each(async function() {
7272
const $container = $(this);
73-
$container.attr('data-image-diff-loaded', 'true');
73+
this.setAttribute('data-image-diff-loaded', 'true');
7474

7575
// the container may be hidden by "viewed" checkbox, so use the parent's width for reference
7676
const diffContainerWidth = Math.max($container.closest('.diff-file-box').width() - 300, 100);

0 commit comments

Comments
 (0)