Skip to content

Commit ba0ef7d

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,11 @@ 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 dropzone = dropzoneContainer.closest('.combo-editor-dropzone')?.querySelector('.dropzone');
552+
const hasUploadedFiles = dropzone?.querySelector('.dz-preview') !== null;
553+
if (!hasUploadedFiles) hideElem(dropzoneContainer);
554+
});
551555

552556
// activate this markdown editor
553557
hideElem(fieldTextarea);

0 commit comments

Comments
 (0)