Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-04-08 18:17:29 +0300
committerGitHub <noreply@github.com>2025-04-08 18:17:29 +0300
commit8ef447a997aa3ad0e2f333b1b71c2cbc91a40395 (patch)
treedd95a15bdc3f988d240b25c422b0c03caf8bc3c3 /web/html/modals
parent520f7a2d15faae41b2ae33d09fb4af8a499aebef (diff)
chore: create `FileManager` class for downloading files
Diffstat (limited to 'web/html/modals')
-rw-r--r--web/html/modals/text_modal.html13
1 files changed, 1 insertions, 12 deletions
diff --git a/web/html/modals/text_modal.html b/web/html/modals/text_modal.html
index cd90821d..38844e92 100644
--- a/web/html/modals/text_modal.html
+++ b/web/html/modals/text_modal.html
@@ -5,7 +5,7 @@
:autosize="{ minRows: 10, maxRows: 20}"></a-input>
<template slot="footer">
<a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download"
- @click="txtModal.download(txtModal.content, txtModal.fileName)">
+ @click="FileManager.downloadTextFile(txtModal.content, txtModal.fileName)">
<span>[[ txtModal.fileName ]]</span>
</a-button>
<a-button type="primary" icon="copy" @click="txtModal.copy(txtModal.content)">
@@ -35,17 +35,6 @@
this.close();
})
},
- download: function (content = '', fileName = '') {
- let link = document.createElement('a');
-
- link.download = fileName;
- link.href = URL.createObjectURL(new Blob([content], { type: 'text/plain' }));
- link.click();
-
- URL.revokeObjectURL(link.href);
-
- link.remove();
- },
close: function () {
this.visible = false;
},