mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	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  Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		| @@ -1,4 +1,5 @@ | |||||||
| import $ from 'jquery'; | import $ from 'jquery'; | ||||||
|  | import {GET} from '../modules/fetch.js'; | ||||||
|  |  | ||||||
| export function initRepoGraphGit() { | export function initRepoGraphGit() { | ||||||
|   const graphContainer = document.getElementById('git-graph-container'); |   const graphContainer = document.getElementById('git-graph-container'); | ||||||
| @@ -60,7 +61,9 @@ export function initRepoGraphGit() { | |||||||
|     $('#rev-container').addClass('gt-hidden'); |     $('#rev-container').addClass('gt-hidden'); | ||||||
|     $('#loading-indicator').removeClass('gt-hidden'); |     $('#loading-indicator').removeClass('gt-hidden'); | ||||||
|     (async () => { |     (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()); |       $('#pagination').html(div.find('#pagination').html()); | ||||||
|       $('#rel-container').html(div.find('#rel-container').html()); |       $('#rel-container').html(div.find('#rel-container').html()); | ||||||
|       $('#rev-container').html(div.find('#rev-container').html()); |       $('#rev-container').html(div.find('#rev-container').html()); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user