From 26bf693dbdc2db0222ee37615e353f7ca1fdd3c1 Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Fri, 7 Mar 2025 07:27:33 +0000 Subject: refactor: move copy function to utils.js --- web/html/common/qrcode_modal.html | 16 +++++++++------- web/html/common/text_modal.html | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'web/html/common') diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 117dd640..914290f6 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 ]] - + @@ -78,10 +78,12 @@ qrModal: qrModal, }, methods: { - copyToClipboard(content) { - return copyToClipboard(content).then(() => { - app.$message.success('{{ i18n "copied" }}') - }) + copy(content) { + ClipboardManager + .copyText(content) + .then(() => { + app.$message.success('{{ i18n "copied" }}') + }) }, setQrCode(elementId, content) { new QRious({ diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html index 36589199..c15282b9 100644 --- a/web/html/common/text_modal.html +++ b/web/html/common/text_modal.html @@ -28,10 +28,12 @@ this.visible = true; }, copy: function (content = '') { - copyToClipboard(content).then(() => { - app.$message.success('{{ i18n "copied" }}') - this.close(); - }) + ClipboardManager + .copyText(content) + .then(() => { + app.$message.success('{{ i18n "copied" }}') + this.close(); + }) }, close: function () { this.visible = false; -- cgit v1.2.3