Fix Pay Button code copying

Fixes #3489.
This commit is contained in:
Dennis Reimann 2022-02-24 12:18:48 +01:00 committed by Andrew Camilleri
parent 4a05f16050
commit 8d25df5d4e
2 changed files with 3 additions and 2 deletions

View File

@ -364,7 +364,8 @@
<div class="col-xxl-8">
<pre><code id="mainCode" class="html"></code></pre>
<button class="btn btn-primary" data-clipboard-target="#mainCode">
<i class="fa fa-copy"></i> Copy Code
<vc:icon symbol="copy"/>
Copy Code
</button>
</div>
</div>

View File

@ -7,7 +7,7 @@ const confirmCopy = (el, message) => {
window.copyToClipboard = function (e, data) {
e.preventDefault();
const item = e.target.closest('[data-clipboard]');
const item = e.target.closest('[data-clipboard]') || e.target.closest('[data-clipboard-target]');
const confirm = item.querySelector('[data-clipboard-confirm]') || item;
const message = confirm.getAttribute('data-clipboard-confirm') || 'Copied ✔';
if (!confirm.dataset.clipboardInitial) {