diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-01-08 21:33:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-08 21:33:32 +0800 |
commit | 70d7475356921b2c9f1f7ceb2c3010ce449bcc2c (patch) | |
tree | 14f68091e58fe2431ac613ffb744ee819a1dffc4 | |
parent | 4f7764561a31c89b7b1097436d64fee4ded4a77c (diff) | |
download | gitea-70d7475356921b2c9f1f7ceb2c3010ce449bcc2c.tar.gz gitea-70d7475356921b2c9f1f7ceb2c3010ce449bcc2c.zip |
Fix EasyMDE image paste bug during refactoring (#18207)
-rw-r--r-- | web_src/js/features/repo-issue.js | 6 | ||||
-rw-r--r-- | web_src/js/features/repo-legacy.js | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index c2b0254a81..6e57facfd2 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -458,8 +458,10 @@ export function initRepoPullRequestReview() { const $reviewBox = $('.review-box'); if ($reviewBox.length === 1) { - createCommentEasyMDE($reviewBox.find('textarea')); - initCompImagePaste($reviewBox); + (async () => { + await createCommentEasyMDE($reviewBox.find('textarea')); + initCompImagePaste($reviewBox); + })(); } // The following part is only for diff views diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index c364beada9..f30345bfee 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -64,10 +64,13 @@ export function initRepoCommentForm() { }); } - createCommentEasyMDE($('.comment.form textarea:not(.review-textarea)')); + (async () => { + await createCommentEasyMDE($('.comment.form textarea:not(.review-textarea)')); + initCompImagePaste($('.comment.form')); + })(); + initBranchSelector(); initCompMarkupContentPreviewTab($('.comment.form')); - initCompImagePaste($('.comment.form')); // List submits function initListSubmits(selector, outerSelector) { |