Skip to content

Commit d4ac1bd

Browse files
authored
Remove jQuery .attr from the commit graph (#30006)
Switched from jQuery `.attr` to plain javascript `.getAttribute` and `.setAttribute` --------- Signed-off-by: Yarden Shoham <[email protected]>
1 parent dade404 commit d4ac1bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/features/repo-graph.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ export function initRepoGraphGit() {
1818
window.history.replaceState({}, '', window.location.pathname);
1919
}
2020
$('.pagination a').each((_, that) => {
21-
const href = $(that).attr('href');
21+
const href = that.getAttribute('href');
2222
if (!href) return;
2323
const url = new URL(href, window.location);
2424
const params = url.searchParams;
2525
params.set('mode', 'monochrome');
2626
url.search = `?${params.toString()}`;
27-
$(that).attr('href', url.href);
27+
that.setAttribute('href', url.href);
2828
});
2929
});
3030
$('#flow-color-colored').on('click', () => {
3131
$('#flow-color-colored').addClass('active');
3232
$('#flow-color-monochrome').removeClass('active');
3333
$('#git-graph-container').addClass('colored').removeClass('monochrome');
3434
$('.pagination a').each((_, that) => {
35-
const href = $(that).attr('href');
35+
const href = that.getAttribute('href');
3636
if (!href) return;
3737
const url = new URL(href, window.location);
3838
const params = url.searchParams;
3939
params.delete('mode');
4040
url.search = `?${params.toString()}`;
41-
$(that).attr('href', url.href);
41+
that.setAttribute('href', url.href);
4242
});
4343
const params = new URLSearchParams(window.location.search);
4444
params.delete('mode');

0 commit comments

Comments
 (0)