aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-legacy.js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-01-05 20:17:25 +0800
committerGitHub <noreply@github.com>2022-01-05 13:17:25 +0100
commita38ba634a4da15fbb2d1b6ac6742cf01c1503ea4 (patch)
tree9bf892ae0e481e2d3b36b1eaf9a5273152c3c628 /web_src/js/features/repo-legacy.js
parent0572c78938d3d8287f81f53effc7ffaacd75d3e7 (diff)
downloadgitea-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.js5
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) {