mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Don't warn users about *every* dirty form (#3707)
The choice regarding which forms should or should not trigger a warning is subjective. I tried to be consistent and not warn about forms that: - run an action, rather than edit data: search, send an email. - delete data: a warning about losing data would be confusing Note that forms on sign-in pages were already ignored (using a selector, rather than an explicit class on the form element). Fixes #3698.
This commit is contained in:
		@@ -1663,8 +1663,11 @@ function selectRange($list, $select, $from) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$(function () {
 | 
			
		||||
    if ($('.user.signin').length > 0) return;
 | 
			
		||||
    $('form').areYouSure();
 | 
			
		||||
    // Warn users that try to leave a page after entering data into a form.
 | 
			
		||||
    // Except on sign-in pages, and for forms marked as 'ignore-dirty'.
 | 
			
		||||
    if ($('.user.signin').length === 0) {
 | 
			
		||||
      $('form:not(.ignore-dirty)').areYouSure();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Parse SSH Key
 | 
			
		||||
    $("#ssh-key-content").on('change paste keyup',function(){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user