Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EasyMDE image paste bug during refactoring #18207

Merged
merged 3 commits into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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