aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-02-25 06:09:55 +0200
committerGitHub <noreply@github.com>2024-02-25 12:09:55 +0800
commitb616f666b89f57f3c285b70c11693f50ba38bcaa (patch)
treeea64035eabba56a575a4bf0c6e8f8fcac9183439
parent328d908b4fb67da0d9e5a031ee0fcd78927baaa3 (diff)
downloadgitea-b616f666b89f57f3c285b70c11693f50ba38bcaa.tar.gz
gitea-b616f666b89f57f3c285b70c11693f50ba38bcaa.zip
Remove jQuery AJAX from the repo commit graph (#29373)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo collaborator mode dropdown functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/7e2f166e-9941-4f26-9666-d00cdf3d9f60) Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
-rw-r--r--web_src/js/features/repo-graph.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web_src/js/features/repo-graph.js b/web_src/js/features/repo-graph.js
index e445ae1103..c83f448b76 100644
--- a/web_src/js/features/repo-graph.js
+++ b/web_src/js/features/repo-graph.js
@@ -1,4 +1,5 @@
import $ from 'jquery';
+import {GET} from '../modules/fetch.js';
export function initRepoGraphGit() {
const graphContainer = document.getElementById('git-graph-container');
@@ -60,7 +61,9 @@ export function initRepoGraphGit() {
$('#rev-container').addClass('gt-hidden');
$('#loading-indicator').removeClass('gt-hidden');
(async () => {
- const div = $(await $.ajax(String(ajaxUrl)));
+ const response = await GET(String(ajaxUrl));
+ const html = await response.text();
+ const div = $(html);
$('#pagination').html(div.find('#pagination').html());
$('#rel-container').html(div.find('#rel-container').html());
$('#rev-container').html(div.find('#rev-container').html());