diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-01-05 20:17:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 13:17:25 +0100 |
commit | a38ba634a4da15fbb2d1b6ac6742cf01c1503ea4 (patch) | |
tree | 9bf892ae0e481e2d3b36b1eaf9a5273152c3c628 /web_src/js/features/repo-legacy.js | |
parent | 0572c78938d3d8287f81f53effc7ffaacd75d3e7 (diff) | |
download | gitea-a38ba634a4da15fbb2d1b6ac6742cf01c1503ea4.tar.gz gitea-a38ba634a4da15fbb2d1b6ac6742cf01c1503ea4.zip |
Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069)
This PR makes frontend load EasyMDE/CodeMirror dynamically, and removes `RequireEasyMDE`.
Diffstat (limited to 'web_src/js/features/repo-legacy.js')
-rw-r--r-- | web_src/js/features/repo-legacy.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index 87d311716a..fccec8ccac 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -1,4 +1,4 @@ -import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/CommentEasyMDE.js'; +import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/EasyMDE.js'; import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js'; import {initCompImagePaste, initEasyMDEImagePaste} from './comp/ImagePaste.js'; import { @@ -256,6 +256,7 @@ export function initRepoCommentForm() { async function onEditContent(event) { event.preventDefault(); + $(this).closest('.dropdown').find('.menu').toggle('visible'); const $segment = $(this).closest('.header').next(); const $editContentZone = $segment.find('.edit-content-zone'); @@ -341,7 +342,7 @@ async function onEditContent(event) { $tabMenu.find('.preview.item').attr('data-tab', $editContentZone.data('preview')); $editContentForm.find('.write').attr('data-tab', $editContentZone.data('write')); $editContentForm.find('.preview').attr('data-tab', $editContentZone.data('preview')); - easyMDE = createCommentEasyMDE($textarea); + easyMDE = await createCommentEasyMDE($textarea); initCompMarkupContentPreviewTab($editContentForm); if ($dropzone.length === 1) { |