From 2d8cca3a2ec1ae9034b7bc28a2fb5f2260f43e1a Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Fri, 7 Mar 2025 02:43:46 +0700
Subject: refactor: delete `clipboardjs` (#2727)
text copying can be done without using additional libraries
---
web/html/common/text_modal.html | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
(limited to 'web/html/common/text_modal.html')
diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html
index d668c792..36589199 100644
--- a/web/html/common/text_modal.html
+++ b/web/html/common/text_modal.html
@@ -7,7 +7,7 @@
:href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)"
:download="txtModal.fileName">[[ txtModal.fileName ]]
- {{ i18n "copy" }}
+ {{ i18n "copy" }}
@@ -20,24 +20,18 @@
content: '',
fileName: '',
qrcode: null,
- clipboard: null,
visible: false,
show: function (title = '', content = '', fileName = '') {
this.title = title;
this.content = content;
this.fileName = fileName;
this.visible = true;
- textModalApp.$nextTick(() => {
- if (this.clipboard === null) {
- this.clipboard = new ClipboardJS('#copy-btn', {
- text: () => this.content,
- });
- this.clipboard.on('success', () => {
- app.$message.success('{{ i18n "copied" }}')
- this.close();
- });
- }
- });
+ },
+ copy: function (content = '') {
+ copyToClipboard(content).then(() => {
+ app.$message.success('{{ i18n "copied" }}')
+ this.close();
+ })
},
close: function () {
this.visible = false;
--
cgit v1.2.3