Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069)
This PR makes frontend load EasyMDE/CodeMirror dynamically, and removes `RequireEasyMDE`.
This commit is contained in:
parent
0572c78938
commit
a38ba634a4
17 changed files with 239 additions and 223 deletions
|
@ -1,7 +1,7 @@
|
|||
import attachTribute from './tribute.js';
|
||||
import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js';
|
||||
import {initEasyMDEImagePaste} from './comp/ImagePaste.js';
|
||||
import {createCommentEasyMDE} from './comp/CommentEasyMDE.js';
|
||||
import {createCommentEasyMDE} from './comp/EasyMDE.js';
|
||||
|
||||
export function initRepoRelease() {
|
||||
$(document).on('click', '.remove-rel-attach', function() {
|
||||
|
@ -19,11 +19,13 @@ export function initRepoReleaseEditor() {
|
|||
return false;
|
||||
}
|
||||
|
||||
const $textarea = $editor.find('textarea');
|
||||
attachTribute($textarea.get(), {mentions: false, emoji: true});
|
||||
const $files = $editor.parent().find('.files');
|
||||
const easyMDE = createCommentEasyMDE($textarea);
|
||||
initCompMarkupContentPreviewTab($editor);
|
||||
const dropzone = $editor.parent().find('.dropzone')[0];
|
||||
initEasyMDEImagePaste(easyMDE, dropzone, $files);
|
||||
(async () => {
|
||||
const $textarea = $editor.find('textarea');
|
||||
await attachTribute($textarea.get(), {mentions: false, emoji: true});
|
||||
const $files = $editor.parent().find('.files');
|
||||
const easyMDE = await createCommentEasyMDE($textarea);
|
||||
initCompMarkupContentPreviewTab($editor);
|
||||
const dropzone = $editor.parent().find('.dropzone')[0];
|
||||
initEasyMDEImagePaste(easyMDE, dropzone, $files);
|
||||
})();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue