aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-issue.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/repo-issue.ts')
-rw-r--r--web_src/js/features/repo-issue.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/web_src/js/features/repo-issue.ts b/web_src/js/features/repo-issue.ts
index 49e8fc40a2..b330b4869b 100644
--- a/web_src/js/features/repo-issue.ts
+++ b/web_src/js/features/repo-issue.ts
@@ -542,7 +542,12 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) {
// deactivate all markdown editors
showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real'));
hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor'));
- hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-dropzone'));
+ queryElems(commentForm, '.combo-editor-dropzone .form-field-dropzone', (dropzoneContainer) => {
+ // if "form-field-dropzone" exists, then "dropzone" must also exist
+ const dropzone = dropzoneContainer.querySelector<HTMLElement>('.dropzone').dropzone;
+ const hasUploadedFiles = dropzone.files.length !== 0;
+ toggleElem(dropzoneContainer, hasUploadedFiles);
+ });
// activate this markdown editor
hideElem(fieldTextarea);