mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-07 15:24:31 +01:00
UI: Prevent copy to clipboard double-clicks
As long as the copy confirmation is shown, it should not allow the handler to be called again. Fixes #6632.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
function confirmCopy(el, message) {
|
||||
if (el.dataset.clipboardConfirming) return;
|
||||
const hasIcon = !!el.innerHTML.match('icon-actions-copy')
|
||||
const confirmHTML = `<span class="text-success">${message}</span>`;
|
||||
if (hasIcon) {
|
||||
@@ -10,7 +11,7 @@ function confirmCopy(el, message) {
|
||||
el.style.minHeight = height + 'px';
|
||||
el.innerHTML = confirmHTML;
|
||||
}
|
||||
el.dataset.clipboardConfirming = true;
|
||||
el.dataset.clipboardConfirming = 'true';
|
||||
if (el.dataset.clipboardHandler) {
|
||||
clearTimeout(parseInt(el.dataset.clipboardHandler));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user