Lines 3-9
Link Here
|
3 |
"[data-copy-to-clipboard]" |
3 |
"[data-copy-to-clipboard]" |
4 |
); |
4 |
); |
5 |
if (copyToClipboardButtons.length) { |
5 |
if (copyToClipboardButtons.length) { |
6 |
const copyToClipboard = e => { |
6 |
const copyToClipboard = async e => { |
7 |
const target = e.target; |
7 |
const target = e.target; |
8 |
if (!(target instanceof HTMLButtonElement)) { |
8 |
if (!(target instanceof HTMLButtonElement)) { |
9 |
return; |
9 |
return; |
Lines 13-19
Link Here
|
13 |
return; |
13 |
return; |
14 |
} |
14 |
} |
15 |
|
15 |
|
16 |
navigator.clipboard.writeText(value); |
16 |
try { |
|
|
17 |
await navigator.clipboard.writeText(value); |
18 |
} catch (_) { |
19 |
return; |
20 |
} |
17 |
|
21 |
|
18 |
target.title = __("Copied to clipboard"); |
22 |
target.title = __("Copied to clipboard"); |
19 |
const tooltip = bootstrap.Tooltip.getOrCreateInstance(target); |
23 |
const tooltip = bootstrap.Tooltip.getOrCreateInstance(target); |
20 |
- |
|
|