Bugfix: Allow/disallow multiple files for dropzone (#2429)
* Bugfix: Allow/disallow multiple files for dropzone --------- Co-authored-by: Nikolaj Brask-Nielsen <nikolajgive@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ export class UmbMediaCollectionElement extends UmbCollectionDefaultElement {
|
||||
<umb-media-collection-toolbar slot="header"></umb-media-collection-toolbar>
|
||||
${when(this._progress >= 0, () => html`<uui-loader-bar progress=${this._progress}></uui-loader-bar>`)}
|
||||
<umb-dropzone
|
||||
multiple
|
||||
.parentUnique=${this._unique}
|
||||
@complete=${this.#onComplete}
|
||||
@progress=${this.#onProgress}></umb-dropzone>
|
||||
|
||||
@@ -346,7 +346,7 @@ export class UmbInputRichMediaElement extends UUIFormControlMixin(UmbLitElement,
|
||||
#renderDropzone() {
|
||||
if (this.readonly) return nothing;
|
||||
if (this._cards && this._cards.length >= this.max) return;
|
||||
return html`<umb-dropzone @complete=${this.#onUploadCompleted}></umb-dropzone>`;
|
||||
return html`<umb-dropzone ?multiple=${this.max > 1} @complete=${this.#onUploadCompleted}></umb-dropzone>`;
|
||||
}
|
||||
|
||||
#renderItems() {
|
||||
|
||||
@@ -9,15 +9,15 @@ export class UmbDropzoneElement extends UmbLitElement {
|
||||
@property({ attribute: false })
|
||||
parentUnique: string | null = null;
|
||||
|
||||
@property({ type: Boolean })
|
||||
multiple: boolean = true;
|
||||
|
||||
@property({ type: Boolean })
|
||||
createAsTemporary: boolean = false;
|
||||
|
||||
@property({ type: String })
|
||||
accept?: string;
|
||||
|
||||
@property({ type: Boolean, reflect: true })
|
||||
multiple: boolean = false;
|
||||
|
||||
@property({ type: Boolean, reflect: true })
|
||||
disabled = false;
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ export class UmbMediaPickerModalElement extends UmbModalBaseElement<
|
||||
|
||||
#renderBody() {
|
||||
return html`${this.#renderToolbar()}
|
||||
<umb-dropzone id="dropzone" @complete=${() => this.#loadMediaFolder()} .parentUnique=${this._currentMediaEntity.unique}></umb-dropzone>
|
||||
<umb-dropzone id="dropzone" multiple @complete=${() => this.#loadMediaFolder()} .parentUnique=${this._currentMediaEntity.unique}></umb-dropzone>
|
||||
${
|
||||
!this._mediaFilteredList.length
|
||||
? html`<div class="container"><p>${this.localize.term('content_listViewNoItems')}</p></div>`
|
||||
|
||||
Reference in New Issue
Block a user