mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Backport of #13830 Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -862,25 +862,23 @@ async function initRepository() {
 | 
				
			|||||||
      const target = $(this).data('target');
 | 
					      const target = $(this).data('target');
 | 
				
			||||||
      const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> ');
 | 
					      const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> ');
 | 
				
			||||||
      const content = `> ${quote}\n\n`;
 | 
					      const content = `> ${quote}\n\n`;
 | 
				
			||||||
 | 
					      let $simplemde = autoSimpleMDE;
 | 
				
			||||||
      let $content;
 | 
					 | 
				
			||||||
      if ($(this).hasClass('quote-reply-diff')) {
 | 
					      if ($(this).hasClass('quote-reply-diff')) {
 | 
				
			||||||
        const $parent = $(this).closest('.comment-code-cloud');
 | 
					        const $parent = $(this).closest('.comment-code-cloud');
 | 
				
			||||||
        $parent.find('button.comment-form-reply').trigger('click');
 | 
					        $parent.find('button.comment-form-reply').trigger('click');
 | 
				
			||||||
        $content = $parent.find('[name="content"]');
 | 
					        $simplemde = $parent.find('[name="content"]').data('simplemde');
 | 
				
			||||||
        if ($content.val() !== '') {
 | 
					      }
 | 
				
			||||||
          $content.val(`${$content.val()}\n\n${content}`);
 | 
					      if ($simplemde !== null) {
 | 
				
			||||||
 | 
					        if ($simplemde.value() !== '') {
 | 
				
			||||||
 | 
					          $simplemde.value(`${$simplemde.value()}\n\n${content}`);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          $content.val(`${content}`);
 | 
					          $simplemde.value(`${content}`);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        $content.focus();
 | 
					 | 
				
			||||||
      } else if (autoSimpleMDE !== null) {
 | 
					 | 
				
			||||||
        if (autoSimpleMDE.value() !== '') {
 | 
					 | 
				
			||||||
          autoSimpleMDE.value(`${autoSimpleMDE.value()}\n\n${content}`);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          autoSimpleMDE.value(`${content}`);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      requestAnimationFrame(() => {
 | 
				
			||||||
 | 
					        $simplemde.codemirror.focus();
 | 
				
			||||||
 | 
					        $simplemde.codemirror.setCursor($simplemde.codemirror.lineCount(), 0);
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
      event.preventDefault();
 | 
					      event.preventDefault();
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1043,8 +1041,10 @@ async function initRepository() {
 | 
				
			|||||||
        $textarea.val($rawContent.text());
 | 
					        $textarea.val($rawContent.text());
 | 
				
			||||||
        $simplemde.value($rawContent.text());
 | 
					        $simplemde.value($rawContent.text());
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      $textarea.focus();
 | 
					      requestAnimationFrame(() => {
 | 
				
			||||||
      $simplemde.codemirror.focus();
 | 
					        $textarea.focus();
 | 
				
			||||||
 | 
					        $simplemde.codemirror.focus();
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
      event.preventDefault();
 | 
					      event.preventDefault();
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user