]> gitweb.hhaalo.de Git - speisekarten-editor.git/commitdiff
change: link follow export click
authorBastian Dehn <hhaalo@arcor.de>
Mon, 6 Jun 2022 17:01:26 +0000 (19:01 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 6 Jun 2022 17:01:26 +0000 (19:01 +0200)
src/app/app.component.html
src/app/app.component.ts

index d9cf52b56060000b6478a9a7022de536d9a57cd2..20faa0f11d9ea60006112722ae7d2fb053f24142 100644 (file)
@@ -6,13 +6,10 @@
        type="button"
        id="exportJson"
        (click)="exportJson()">Export</button>
-<button class="button"
-       type="button"
-       [disabled]="downloadJsonHref === ''"
-       id="downloadJson">
-       <a [href]="downloadJsonHref"
-       [hidden]="downloadJsonHref === ''"
-       download="speisekarte.json">Download</a></button>
+<a [href]="downloadJsonHref"
+       id="exportLink"
+       hidden="hidden"
+       download="speisekarte.json">Download</a>
 
 <button class="button main"
        type="button"
index ca02bfcf6da9bb011fea493dac5b4ed8f6b78e0c..8b952328b42b30cd4e6b65fbd95df5f615064995 100644 (file)
@@ -66,6 +66,8 @@ export class AppComponent
                let uri = this.sanitizer.bypassSecurityTrustUrl(
                        "data:text/json;charset=UTF-8," + json);
                this.downloadJsonHref = uri;
+               let element = document.getElementById("exportLink");
+               element?.click();
        }
 
        public fileEvent(event: any): void