Skip to content

Commit dd04385

Browse files
authored
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 <[email protected]>
1 parent cb98e27 commit dd04385

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/features/repo-common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function getArchive($target, url, first) {
3434
export function initRepoArchiveLinks() {
3535
$('.archive-link').on('click', function (event) {
3636
event.preventDefault();
37-
const url = $(this).attr('href');
37+
const url = this.getAttribute('href');
3838
if (!url) return;
3939
getArchive($(event.target), url, true);
4040
});
@@ -80,10 +80,10 @@ export function initRepoCommonFilterSearchDropdown(selector) {
8080
fullTextSearch: 'exact',
8181
selectOnKeydown: false,
8282
onChange(_text, _value, $choice) {
83-
if ($choice.attr('data-url')) {
84-
window.location.href = $choice.attr('data-url');
83+
if ($choice[0].getAttribute('data-url')) {
84+
window.location.href = $choice[0].getAttribute('data-url');
8585
}
8686
},
87-
message: {noResults: $dropdown.attr('data-no-results')},
87+
message: {noResults: $dropdown[0].getAttribute('data-no-results')},
8888
});
8989
}

0 commit comments

Comments
 (0)