mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Backport #35156 by @bartvdbraak Instead of always hiding the dropzone when it's not active: - hide it when when there are no uploaded files and it becomes inactive - don't hide it when there are uploaded files Fixes #35125 Co-authored-by: Bart van der Braak <bartvdbraak@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -547,7 +547,12 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) { | |||||||
|       // deactivate all markdown editors |       // deactivate all markdown editors | ||||||
|       showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real')); |       showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real')); | ||||||
|       hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor')); |       hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor')); | ||||||
|       hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-dropzone')); |       queryElems(commentForm, '.combo-editor-dropzone .form-field-dropzone', (dropzoneContainer) => { | ||||||
|  |         // if "form-field-dropzone" exists, then "dropzone" must also exist | ||||||
|  |         const dropzone = dropzoneContainer.querySelector<HTMLElement>('.dropzone').dropzone; | ||||||
|  |         const hasUploadedFiles = dropzone.files.length !== 0; | ||||||
|  |         toggleElem(dropzoneContainer, hasUploadedFiles); | ||||||
|  |       }); | ||||||
|  |  | ||||||
|       // activate this markdown editor |       // activate this markdown editor | ||||||
|       hideElem(fieldTextarea); |       hideElem(fieldTextarea); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user