From 06ddf37817c0ad648a3e1a2ed64854aa13eb6392 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 10 May 2021 23:46:19 +0200 Subject: [PATCH] Add a download utility (currently unused) --- Utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utils.ts b/Utils.ts index b9cdb333e6..9754abc268 100644 --- a/Utils.ts +++ b/Utils.ts @@ -291,6 +291,11 @@ export class Utils { return result; } + /** + * Triggers a 'download file' popup which will download the contents + * @param contents + * @param fileName + */ public static downloadTxtFile (contents: string, fileName: string = "download.txt") { const element = document.createElement("a"); const file = new Blob([contents], {type: 'text/plain'}); @@ -299,6 +304,7 @@ export class Utils { document.body.appendChild(element); // Required for this to work in FireFox element.click(); } + } export interface TileRange{