summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-issue.js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-06-29 01:52:58 +0800
committerGitHub <noreply@github.com>2022-06-29 01:52:58 +0800
commit76910f213f2765b0bdf16e0d5ec48ffbd3c9f55e (patch)
tree4261947b85f275da39a53f032374c5a0a867a2b1 /web_src/js/features/repo-issue.js
parentcdd6371ad484cce6233892d8f6744b52cd38e0c8 (diff)
downloadgitea-76910f213f2765b0bdf16e0d5ec48ffbd3c9f55e.tar.gz
gitea-76910f213f2765b0bdf16e0d5ec48ffbd3c9f55e.zip
Enable spellcheck for EasyMDE, use contenteditable mode (#19776)
Enable spellcheck for EasyMDE, use contenteditable mode. Rewrite and refactor the ImagePaste code.
Diffstat (limited to 'web_src/js/features/repo-issue.js')
-rw-r--r--web_src/js/features/repo-issue.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index bdd616f071..12900c2455 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -2,7 +2,7 @@ import $ from 'jquery';
import {htmlEscape} from 'escape-goat';
import attachTribute from './tribute.js';
import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/EasyMDE.js';
-import {initCompImagePaste} from './comp/ImagePaste.js';
+import {initEasyMDEImagePaste} from './comp/ImagePaste.js';
import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js';
const {appSubUrl, csrfToken} = window.config;
@@ -480,8 +480,9 @@ export function initRepoPullRequestReview() {
// the editor's height is too large in some cases, and the panel cannot be scrolled with page now because there is `.repository .diff-detail-box.sticky { position: sticky; }`
// the temporary solution is to make the editor's height smaller (about 4 lines). GitHub also only show 4 lines for default. We can improve the UI (including Dropzone area) in future
// EasyMDE's options can not handle minHeight & maxHeight together correctly, we have to set max-height for .CodeMirror-scroll in CSS.
- await createCommentEasyMDE($reviewBox.find('textarea'), {minHeight: '80px'});
- initCompImagePaste($reviewBox);
+ const $reviewTextarea = $reviewBox.find('textarea');
+ const easyMDE = await createCommentEasyMDE($reviewTextarea, {minHeight: '80px'});
+ initEasyMDEImagePaste(easyMDE, $reviewBox.find('.dropzone'));
})();
}