diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
| commit | 96786c94189f3d2f3f04c1915529c786228bdf42 (patch) | |
| tree | 879085e09a3cd485f3246f46be907fe77eb84a1a /web/html/common/qrcode_modal.html | |
| parent | bc56e637376142c370c31b17558fc3778a863bd2 (diff) | |
alireza
Diffstat (limited to 'web/html/common/qrcode_modal.html')
| -rw-r--r-- | web/html/common/qrcode_modal.html | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index e6a6d476..6c9afbb3 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -1,9 +1,10 @@ {{define "qrcodeModal"}} <a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title" :closable="true" width="300px" :ok-text="qrModal.okText" - :class="siderDrawer.isDarkTheme ? darkClass : ''" + :class="siderDrawer.isDarkTheme ? darkClass : ''" cancel-text='{{ i18n "close" }}' :ok-button-props="{attrs:{id:'qr-modal-ok-btn'}}"> - <canvas id="qrCode" style="width: 100%; height: 100%;"></canvas> + <a-tag color="green" style="margin-bottom: 10px;display: block;text-align: center;" >{{ i18n "pages.inbounds.clickOnQRcode" }}</a-tag> + <canvas @click="copyToClipboard()" id="qrCode" style="width: 100%; height: 100%;"></canvas> </a-modal> <script> @@ -35,7 +36,10 @@ this.clipboard = new ClipboardJS('#qr-modal-ok-btn', { text: () => this.copyText, }); - this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); + this.clipboard.on('success', () => { + app.$message.success('{{ i18n "copied" }}') + this.clipboard.destroy(); + }); } if (this.qrcode === null) { this.qrcode = new QRious({ @@ -58,6 +62,17 @@ data: { qrModal: qrModal, }, + methods: { + copyToClipboard() { + this.qrModal.clipboard = new ClipboardJS('#qrCode', { + text: () => this.qrModal.copyText, + }); + this.qrModal.clipboard.on('success', () => { + app.$message.success('{{ i18n "copied" }}') + this.qrModal.clipboard.destroy(); + }); + } + }, }); </script> |
