1
0
Fork 0
mirror of synced 2024-06-27 10:41:00 +12:00

Fixed copy to work with non-disabled fields

This commit is contained in:
Eldad Fux 2020-03-13 09:21:09 +02:00
parent e5f99f9874
commit c6d933789d

View file

@ -13,6 +13,8 @@
element.parentNode.insertBefore(button, element.nextSibling);
var copy = function(event) {
let disabled = element.disabled;
element.disabled = false;
element.focus();
@ -26,7 +28,7 @@
window.getSelection().removeAllRanges();
}
element.disabled = true;
element.disabled = disabled;
alerts.add({ text: "Copied to clipboard", class: "" }, 3000);
};