Fix EasyMDE image paste bug during refactoring (#18207)

tokarchuk/v1.17
wxiaoguang 3 years ago committed by GitHub
parent 4f7764561a
commit 70d7475356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      web_src/js/features/repo-issue.js
  2. 7
      web_src/js/features/repo-legacy.js

@ -458,8 +458,10 @@ export function initRepoPullRequestReview() {
const $reviewBox = $('.review-box'); const $reviewBox = $('.review-box');
if ($reviewBox.length === 1) { if ($reviewBox.length === 1) {
createCommentEasyMDE($reviewBox.find('textarea')); (async () => {
initCompImagePaste($reviewBox); await createCommentEasyMDE($reviewBox.find('textarea'));
initCompImagePaste($reviewBox);
})();
} }
// The following part is only for diff views // The following part is only for diff views

@ -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(); initBranchSelector();
initCompMarkupContentPreviewTab($('.comment.form')); initCompMarkupContentPreviewTab($('.comment.form'));
initCompImagePaste($('.comment.form'));
// List submits // List submits
function initListSubmits(selector, outerSelector) { function initListSubmits(selector, outerSelector) {

Loading…
Cancel
Save