mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Add toasts to UI (#25449)
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
This commit is contained in:
		
							
								
								
									
										11
									
								
								web_src/js/standalone/devtest.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								web_src/js/standalone/devtest.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| import {showInfoToast, showWarningToast, showErrorToast} from '../modules/toast.js'; | ||||
|  | ||||
| document.getElementById('info-toast').addEventListener('click', () => { | ||||
|   showInfoToast('success 😀'); | ||||
| }); | ||||
| document.getElementById('warning-toast').addEventListener('click', () => { | ||||
|   showWarningToast('warning 😐'); | ||||
| }); | ||||
| document.getElementById('error-toast').addEventListener('click', () => { | ||||
|   showErrorToast('error 🙁'); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user
	 silverwind
					silverwind