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) { ...@@ -82,9 +82,11 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
break; break;
case "isDialogOpen": case "isDialogOpen":
if (this.isDialogOpen) { if (this.isDialogOpen) {
// this.setAttribute("dialog-open", "");
this.openDialog(); this.openDialog();
} else { } else {
this.removeAttribute("dialog-open"); this.removeAttribute("dialog-open");
// this.closeDialog();
} }
break; break;
...@@ -184,6 +186,8 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) { ...@@ -184,6 +186,8 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
// this.dispatchEvent(new CustomEvent("vpu-file-source-selection-finished", // this.dispatchEvent(new CustomEvent("vpu-file-source-selection-finished",
// { "detail": {}, bubbles: true, composed: true })); // { "detail": {}, bubbles: true, composed: true }));
this.closeDialog();
} }
/** /**
...@@ -292,12 +296,16 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) { ...@@ -292,12 +296,16 @@ export class FileSource extends ScopedElementsMixin(VPULitElement) {
openDialog() { openDialog() {
console.log("openDialog"); console.log("openDialog");
console.log(this._('#modal-picker'));
MicroModal.show(this._('#modal-picker'), { MicroModal.show(this._('#modal-picker'), {
onClose: modal => { this.isDialogOpen = false; } onClose: modal => { this.isDialogOpen = false; }
}); });
} }
closeDialog() {
console.log("closeDialog");
MicroModal.close();
}
static get styles() { static get styles() {
// language=css // language=css
return 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