-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE #18069
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
Changes from all commits
3338246
65b4fd3
9a1bec6
fc79e5e
6e895b5
5f40044
791e566
ee23af5
398237e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {htmlEscape} from 'escape-goat'; | ||
import attachTribute from './tribute.js'; | ||
import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/CommentEasyMDE.js'; | ||
import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/EasyMDE.js'; | ||
import {initCompImagePaste} from './comp/ImagePaste.js'; | ||
import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js'; | ||
|
||
|
@@ -439,16 +439,17 @@ export function initRepoPullRequestReview() { | |
$(`#show-outdated-${id}`).removeClass('hide'); | ||
}); | ||
|
||
$(document).on('click', 'button.comment-form-reply', function (e) { | ||
$(document).on('click', 'button.comment-form-reply', async function (e) { | ||
e.preventDefault(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIFE needed for this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, it would submit a form? |
||
|
||
$(this).hide(); | ||
const form = $(this).closest('.comment-code-cloud').find('.comment-form'); | ||
form.removeClass('hide'); | ||
const $textarea = form.find('textarea'); | ||
let easyMDE = getAttachedEasyMDE($textarea); | ||
if (!easyMDE) { | ||
attachTribute($textarea.get(), {mentions: true, emoji: true}); | ||
easyMDE = createCommentEasyMDE($textarea); | ||
await attachTribute($textarea.get(), {mentions: true, emoji: true}); | ||
easyMDE = await createCommentEasyMDE($textarea); | ||
} | ||
$textarea.focus(); | ||
easyMDE.codemirror.focus(); | ||
|
@@ -515,8 +516,8 @@ export function initRepoPullRequestReview() { | |
td.find("input[name='side']").val(side === 'left' ? 'previous' : 'proposed'); | ||
td.find("input[name='path']").val(path); | ||
const $textarea = commentCloud.find('textarea'); | ||
attachTribute($textarea.get(), {mentions: true, emoji: true}); | ||
const easyMDE = createCommentEasyMDE($textarea); | ||
await attachTribute($textarea.get(), {mentions: true, emoji: true}); | ||
const easyMDE = await createCommentEasyMDE($textarea); | ||
$textarea.focus(); | ||
easyMDE.codemirror.focus(); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.