mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Backport #27746 by @lng2020 When hitting the `enter` key to create a new project column, the request is sent twice because the `submit` event and `key up` event are both triggered. Probably a better solution is to rewrite these parts of the code to avoid using native jQuery but reuse the `form-fetch-action` class. But it's beyond my ability. Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
This commit is contained in:
		| @@ -193,20 +193,6 @@ export function initRepoProject() { | ||||
|     const url = $(this).data('url'); | ||||
|     createNewColumn(url, columnTitle, projectColorInput); | ||||
|   }); | ||||
|  | ||||
|   $('.new-project-column').on('input keyup', (e) => { | ||||
|     const columnTitle = $('#new_project_column'); | ||||
|     const projectColorInput = $('#new_project_column_color_picker'); | ||||
|     if (!columnTitle.val()) { | ||||
|       $('#new_project_column_submit').addClass('disabled'); | ||||
|       return; | ||||
|     } | ||||
|     $('#new_project_column_submit').removeClass('disabled'); | ||||
|     if (e.key === 'Enter') { | ||||
|       const url = $(this).data('url'); | ||||
|       createNewColumn(url, columnTitle, projectColorInput); | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function setLabelColor(label, color) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Giteabot
					Giteabot