mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 20:34:37 +01:00
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>
This commit is contained in:
parent
cb98e27992
commit
dd043854ee
1 changed files with 4 additions and 4 deletions
|
@ -34,7 +34,7 @@ async function getArchive($target, url, first) {
|
||||||
export function initRepoArchiveLinks() {
|
export function initRepoArchiveLinks() {
|
||||||
$('.archive-link').on('click', function (event) {
|
$('.archive-link').on('click', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const url = $(this).attr('href');
|
const url = this.getAttribute('href');
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
getArchive($(event.target), url, true);
|
getArchive($(event.target), url, true);
|
||||||
});
|
});
|
||||||
|
@ -80,10 +80,10 @@ export function initRepoCommonFilterSearchDropdown(selector) {
|
||||||
fullTextSearch: 'exact',
|
fullTextSearch: 'exact',
|
||||||
selectOnKeydown: false,
|
selectOnKeydown: false,
|
||||||
onChange(_text, _value, $choice) {
|
onChange(_text, _value, $choice) {
|
||||||
if ($choice.attr('data-url')) {
|
if ($choice[0].getAttribute('data-url')) {
|
||||||
window.location.href = $choice.attr('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')},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue