Skip to content
Snippets Groups Projects
Commit 35f0ea06 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Implement automatic dialog closing after local file upload (#6)

parent 8adbb1fe
No related branches found
No related tags found
No related merge requests found
......@@ -82,9 +82,11 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
break;
case "isDialogOpen":
if (this.isDialogOpen) {
// this.setAttribute("dialog-open", "");
this.openDialog();
} else {
this.removeAttribute("dialog-open");
// this.closeDialog();
}
break;
......@@ -184,6 +186,8 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
// this.dispatchEvent(new CustomEvent("vpu-file-source-selection-finished",
// { "detail": {}, bubbles: true, composed: true }));
this.closeDialog();
}
/**
......@@ -292,12 +296,16 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
openDialog() {
console.log("openDialog");
console.log(this._('#modal-picker'));
MicroModal.show(this._('#modal-picker'), {
onClose: modal => { this.isDialogOpen = false; }
});
}
closeDialog() {
console.log("closeDialog");
MicroModal.close();
}
static get styles() {
// language=css
return css`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment