mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 13:28:25 +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:
		@@ -8,6 +8,7 @@ import {handleGlobalEnterQuickSubmit} from './QuickSubmit.js';
 | 
			
		||||
import {renderPreviewPanelContent} from '../repo-editor.js';
 | 
			
		||||
import {easyMDEToolbarActions} from './EasyMDEToolbarActions.js';
 | 
			
		||||
import {initTextExpander} from './TextExpander.js';
 | 
			
		||||
import {showErrorToast} from '../../modules/toast.js';
 | 
			
		||||
 | 
			
		||||
let elementIdCounter = 0;
 | 
			
		||||
 | 
			
		||||
@@ -26,7 +27,7 @@ export function validateTextareaNonEmpty($textarea) {
 | 
			
		||||
      $form[0]?.reportValidity();
 | 
			
		||||
    } else {
 | 
			
		||||
      // The alert won't hurt users too much, because we are dropping the EasyMDE and the check only occurs in a few places.
 | 
			
		||||
      alert('Require non-empty content');
 | 
			
		||||
      showErrorToast('Require non-empty content');
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user