diff options
author | silverwind <me@silverwind.io> | 2024-06-28 07:59:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 13:59:22 +0800 |
commit | 62b373896869da769992fbad06d13606c57c5585 (patch) | |
tree | f5f685b6937ff75733e3e1a222201fbad1a28bf7 /web_src/js/features | |
parent | d655ff18b3183807dc568b133035c7c555e3b595 (diff) | |
download | gitea-62b373896869da769992fbad06d13606c57c5585.tar.gz gitea-62b373896869da769992fbad06d13606c57c5585.zip |
Fix JS error with disabled attachment and easymde (#31511)
Not sure if this is a regression from
https://github.com/go-gitea/gitea/pull/30513, but when attachments are
disabled, `this.dropzone` is null and the code had failed in
`initEasyMDEPaste` trying to access `dropzoneEl.dropzone`.
Diffstat (limited to 'web_src/js/features')
-rw-r--r-- | web_src/js/features/comp/ComboMarkdownEditor.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web_src/js/features/comp/ComboMarkdownEditor.js b/web_src/js/features/comp/ComboMarkdownEditor.js index 21779e32a8..f511adab1a 100644 --- a/web_src/js/features/comp/ComboMarkdownEditor.js +++ b/web_src/js/features/comp/ComboMarkdownEditor.js @@ -264,7 +264,9 @@ class ComboMarkdownEditor { }); this.applyEditorHeights(this.container.querySelector('.CodeMirror-scroll'), this.options.editorHeights); await attachTribute(this.easyMDE.codemirror.getInputField(), {mentions: true, emoji: true}); - initEasyMDEPaste(this.easyMDE, this.dropzone); + if (this.dropzone) { + initEasyMDEPaste(this.easyMDE, this.dropzone); + } hideElem(this.textareaMarkdownToolbar); } |