From 872287c3804ee796b34ac5d8c61a22e4b31fce35 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Wed, 20 Mar 2024 02:04:24 +0200 Subject: [PATCH] Remove jQuery `.attr` from the archive download and compare page branch selector (#29918) - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the archive download and compare page branch selector functionality and it works as before Signed-off-by: Yarden Shoham (cherry picked from commit dd043854ee8963057daa7b835fc700731ae5fb9e) --- web_src/js/features/repo-common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/repo-common.js b/web_src/js/features/repo-common.js index a8221bbea8..9e11ffe197 100644 --- a/web_src/js/features/repo-common.js +++ b/web_src/js/features/repo-common.js @@ -34,7 +34,7 @@ async function getArchive($target, url, first) { export function initRepoArchiveLinks() { $('.archive-link').on('click', function (event) { event.preventDefault(); - const url = $(this).attr('href'); + const url = this.getAttribute('href'); if (!url) return; getArchive($(event.target), url, true); }); @@ -80,10 +80,10 @@ export function initRepoCommonFilterSearchDropdown(selector) { fullTextSearch: 'exact', selectOnKeydown: false, onChange(_text, _value, $choice) { - if ($choice.attr('data-url')) { - window.location.href = $choice.attr('data-url'); + if ($choice[0].getAttribute('data-url')) { + window.location.href = $choice[0].getAttribute('data-url'); } }, - message: {noResults: $dropdown.attr('data-no-results')}, + message: {noResults: $dropdown[0].getAttribute('data-no-results')}, }); }