From cb98e27992cae7d62e527e922cae3c0f738a7cab Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Wed, 20 Mar 2024 01:49:15 +0200 Subject: [PATCH] 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 --- web_src/js/features/imagediff.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index 293e1f809..2bac13b0b 100644 --- a/web_src/js/features/imagediff.js +++ b/web_src/js/features/imagediff.js @@ -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);