mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Make Ctrl+Enter (quick submit) work for issue comment and wiki editor (#19729)
* Make Ctrl+Enter (quick submit) work for issue comment and wiki editor * Remove the required `SubmitReviewForm.Type`, empty type (triggered by quick submit) means "comment" * Merge duplicate code
This commit is contained in:
		| @@ -355,6 +355,11 @@ async function onEditContent(event) { | ||||
|       initEasyMDEImagePaste(easyMDE, $dropzone[0], $dropzone.find('.files')); | ||||
|     } | ||||
|  | ||||
|     const $saveButton = $editContentZone.find('.save.button'); | ||||
|     $textarea.on('ce-quick-submit', () => { | ||||
|       $saveButton.trigger('click'); | ||||
|     }); | ||||
|  | ||||
|     $editContentZone.find('.cancel.button').on('click', () => { | ||||
|       $renderContent.show(); | ||||
|       $editContentZone.hide(); | ||||
| @@ -362,7 +367,8 @@ async function onEditContent(event) { | ||||
|         dz.emit('reload'); | ||||
|       } | ||||
|     }); | ||||
|     $editContentZone.find('.save.button').on('click', () => { | ||||
|  | ||||
|     $saveButton.on('click', () => { | ||||
|       $renderContent.show(); | ||||
|       $editContentZone.hide(); | ||||
|       const $attachments = $dropzone.find('.files').find('[name=files]').map(function () { | ||||
| @@ -400,7 +406,7 @@ async function onEditContent(event) { | ||||
|         initCommentContent(); | ||||
|       }); | ||||
|     }); | ||||
|   } else { | ||||
|   } else { // use existing form | ||||
|     $textarea = $segment.find('textarea'); | ||||
|     easyMDE = getAttachedEasyMDE($textarea); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 wxiaoguang
					wxiaoguang