summaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-03-23 01:22:01 +0200
committerGitHub <noreply@github.com>2024-03-22 23:22:01 +0000
commitd4ac1bd26e3ebc8e3bc7e84313e566634b672477 (patch)
tree6b162a68bf69e65e7c75716a994164d1e7cce269 /web_src/js/features
parentdade40407e333fbc6811bdd738c3d191b5dc0ef1 (diff)
downloadgitea-d4ac1bd26e3ebc8e3bc7e84313e566634b672477.tar.gz
gitea-d4ac1bd26e3ebc8e3bc7e84313e566634b672477.zip
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>
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/repo-graph.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/web_src/js/features/repo-graph.js b/web_src/js/features/repo-graph.js
index 4fbf95b9d5..f2c0d78f34 100644
--- a/web_src/js/features/repo-graph.js
+++ b/web_src/js/features/repo-graph.js
@@ -18,13 +18,13 @@ export function initRepoGraphGit() {
window.history.replaceState({}, '', window.location.pathname);
}
$('.pagination a').each((_, that) => {
- const href = $(that).attr('href');
+ const href = that.getAttribute('href');
if (!href) return;
const url = new URL(href, window.location);
const params = url.searchParams;
params.set('mode', 'monochrome');
url.search = `?${params.toString()}`;
- $(that).attr('href', url.href);
+ that.setAttribute('href', url.href);
});
});
$('#flow-color-colored').on('click', () => {
@@ -32,13 +32,13 @@ export function initRepoGraphGit() {
$('#flow-color-monochrome').removeClass('active');
$('#git-graph-container').addClass('colored').removeClass('monochrome');
$('.pagination a').each((_, that) => {
- const href = $(that).attr('href');
+ const href = that.getAttribute('href');
if (!href) return;
const url = new URL(href, window.location);
const params = url.searchParams;
params.delete('mode');
url.search = `?${params.toString()}`;
- $(that).attr('href', url.href);
+ that.setAttribute('href', url.href);
});
const params = new URLSearchParams(window.location.search);
params.delete('mode');