From d0d7b4b6d124dd8fd420a5f3850e37794e09e302 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Sat, 23 Mar 2024 13:51:34 +0200 Subject: [PATCH] Remove jQuery `.attr` from the image diff again (#30022) - Follows https://github.com/go-gitea/gitea/pull/29917 Missed these Signed-off-by: Yarden Shoham --- web_src/js/features/imagediff.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index 7b77b30ccc7..d567632f5f1 100644 --- a/web_src/js/features/imagediff.js +++ b/web_src/js/features/imagediff.js @@ -98,8 +98,10 @@ export function initImageDiff() { const text = await resp.text(); const bounds = getDefaultSvgBoundsIfUndefined(text, info.path); if (bounds) { - info.$images.attr('width', bounds.width); - info.$images.attr('height', bounds.height); + info.$images.each(function() { + this.setAttribute('width', bounds.width); + this.setAttribute('height', bounds.height); + }); hideElem(info.$boundsInfo); } }