mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-27 00:23:41 +09:00 
			
		
		
		
	Remove jQuery from the code diff expansion buttons (#29385)
- Removed all jQuery AJAX calls and replaced with htmx - Tested the code diff expansion buttons functionality and it works as before plus a loading indicator # Demo using `htmx` instead of jQuery AJAX  Signed-off-by: Yarden Shoham <git@yardenshoham.com>
This commit is contained in:
		| @@ -186,14 +186,6 @@ export function initRepoCodeView() { | ||||
|   $(document).on('click', '.fold-file', ({currentTarget}) => { | ||||
|     invertFileFolding(currentTarget.closest('.file-content'), currentTarget); | ||||
|   }); | ||||
|   $(document).on('click', '.code-expander-button', async ({currentTarget}) => { | ||||
|     const url = currentTarget.getAttribute('data-url'); | ||||
|     const query = currentTarget.getAttribute('data-query'); | ||||
|     const anchor = currentTarget.getAttribute('data-anchor'); | ||||
|     if (!url) return; | ||||
|     const blob = await $.get(`${url}?${query}&anchor=${anchor}`); | ||||
|     currentTarget.closest('tr').outerHTML = blob; | ||||
|   }); | ||||
|   $(document).on('click', '.copy-line-permalink', async ({currentTarget}) => { | ||||
|     await clippie(toAbsoluteUrl(currentTarget.getAttribute('data-url'))); | ||||
|   }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user