Skip to content

Commit

Permalink
Fix EasyMDE image paste bug during refactoring (#18207)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Jan 8, 2022
1 parent 4f77645 commit 70d7475
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions web_src/js/features/repo-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions web_src/js/features/repo-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 70d7475

Please sign in to comment.