Skip to content

Commit 5906933

Browse files
committed
BLENDER: Only hide dropzone when no files have been uploaded
Upstream patch at go-gitea#35156
1 parent 16163d4 commit 5906933

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,14 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) {
547547
// deactivate all markdown editors
548548
showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real'));
549549
hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor'));
550-
hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-dropzone'));
550+
queryElems(commentForm, '.combo-editor-dropzone .form-field-dropzone', (dropzoneContainer) => {
551+
const dropzoneEl = dropzoneContainer.closest<HTMLElement>('.combo-editor-dropzone')?.querySelector<HTMLElement>('.dropzone');
552+
const dzInstance = dropzoneEl?.dropzone;
553+
554+
if (dzInstance && dzInstance.files.length === 0) {
555+
hideElem(dropzoneContainer);
556+
}
557+
});
551558

552559
// activate this markdown editor
553560
hideElem(fieldTextarea);

0 commit comments

Comments
 (0)