diff options
author | Yarden Shoham <git@yardenshoham.com> | 2024-03-20 01:49:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 23:49:15 +0000 |
commit | cb98e27992cae7d62e527e922cae3c0f738a7cab (patch) | |
tree | 5b8b375fdcfcd355e85149c29836ca0f9e51d4b3 /web_src | |
parent | 4cfda0241993eabb50ed937dab2ffa7deff3d36e (diff) | |
download | gitea-cb98e27992cae7d62e527e922cae3c0f738a7cab.tar.gz gitea-cb98e27992cae7d62e527e922cae3c0f738a7cab.zip |
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 <git@yardenshoham.com>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/features/imagediff.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index 293e1f809a..2bac13b0bf 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); |