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/qrcode_modal.html | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
(limited to 'web/html/common/qrcode_modal.html')
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index 94e750c7..117dd640 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -10,7 +10,7 @@
{{ i18n "pages.settings.subSettings"}}
-
+
@@ -18,7 +18,7 @@
{{ i18n "pages.settings.subSettings"}} Json
-
+
@@ -27,7 +27,7 @@
[[ row.remark ]]
-
+
@@ -41,7 +41,6 @@
dbInbound: new DBInbound(),
client: null,
qrcodes: [],
- clipboard: null,
visible: false,
subId: '',
show: function(title = '', dbInbound, client) {
@@ -79,14 +78,10 @@
qrModal: qrModal,
},
methods: {
- copyToClipboard(elementId, content) {
- this.qrModal.clipboard = new ClipboardJS('#' + elementId, {
- text: () => content,
- });
- this.qrModal.clipboard.on('success', () => {
+ copyToClipboard(content) {
+ return copyToClipboard(content).then(() => {
app.$message.success('{{ i18n "copied" }}')
- this.qrModal.clipboard.destroy();
- });
+ })
},
setQrCode(elementId, content) {
new QRious({
--
cgit v1.2.3