diff options
author | Yarden Shoham <git@yardenshoham.com> | 2024-03-20 02:04:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 00:04:24 +0000 |
commit | dd043854ee8963057daa7b835fc700731ae5fb9e (patch) | |
tree | 1066384b7725dd8f24c16aed7b13022ac02e0d6f | |
parent | cb98e27992cae7d62e527e922cae3c0f738a7cab (diff) | |
download | gitea-dd043854ee8963057daa7b835fc700731ae5fb9e.tar.gz gitea-dd043854ee8963057daa7b835fc700731ae5fb9e.zip |
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 <git@yardenshoham.com>
-rw-r--r-- | web_src/js/features/repo-common.js | 8 |
1 files 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')}, }); } |