mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 12:54:53 -05:00
Remove jQuery .attr
from the commit graph (#30006)
Switched from jQuery `.attr` to plain javascript `.getAttribute` and `.setAttribute` --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> (cherry picked from commit d4ac1bd26e3ebc8e3bc7e84313e566634b672477)
This commit is contained in:
parent
bc31bf2d09
commit
598d7c030d
1 changed files with 4 additions and 4 deletions
|
@ -18,13 +18,13 @@ export function initRepoGraphGit() {
|
||||||
window.history.replaceState({}, '', window.location.pathname);
|
window.history.replaceState({}, '', window.location.pathname);
|
||||||
}
|
}
|
||||||
$('.pagination a').each((_, that) => {
|
$('.pagination a').each((_, that) => {
|
||||||
const href = $(that).attr('href');
|
const href = that.getAttribute('href');
|
||||||
if (!href) return;
|
if (!href) return;
|
||||||
const url = new URL(href, window.location);
|
const url = new URL(href, window.location);
|
||||||
const params = url.searchParams;
|
const params = url.searchParams;
|
||||||
params.set('mode', 'monochrome');
|
params.set('mode', 'monochrome');
|
||||||
url.search = `?${params.toString()}`;
|
url.search = `?${params.toString()}`;
|
||||||
$(that).attr('href', url.href);
|
that.setAttribute('href', url.href);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#flow-color-colored').on('click', () => {
|
$('#flow-color-colored').on('click', () => {
|
||||||
|
@ -32,13 +32,13 @@ export function initRepoGraphGit() {
|
||||||
$('#flow-color-monochrome').removeClass('active');
|
$('#flow-color-monochrome').removeClass('active');
|
||||||
$('#git-graph-container').addClass('colored').removeClass('monochrome');
|
$('#git-graph-container').addClass('colored').removeClass('monochrome');
|
||||||
$('.pagination a').each((_, that) => {
|
$('.pagination a').each((_, that) => {
|
||||||
const href = $(that).attr('href');
|
const href = that.getAttribute('href');
|
||||||
if (!href) return;
|
if (!href) return;
|
||||||
const url = new URL(href, window.location);
|
const url = new URL(href, window.location);
|
||||||
const params = url.searchParams;
|
const params = url.searchParams;
|
||||||
params.delete('mode');
|
params.delete('mode');
|
||||||
url.search = `?${params.toString()}`;
|
url.search = `?${params.toString()}`;
|
||||||
$(that).attr('href', url.href);
|
that.setAttribute('href', url.href);
|
||||||
});
|
});
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
params.delete('mode');
|
params.delete('mode');
|
||||||
|
|
Loading…
Reference in a new issue