1
0
mirror of https://github.com/S2-/pwgen.git synced 2025-08-02 08:50:04 +02:00

add timeout before copying password

This commit is contained in:
s2
2017-11-21 19:33:09 +01:00
parent 81d5bbb055
commit b0932baeea

View File

@@ -35,11 +35,15 @@ function saveOptions(options) {
}
function copypasstoclippboard() {
setTimeout(function() {
var copyText = document.getElementById('pw');
copyText.select();
document.execCommand('copy');
}, 100);
}
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('new').addEventListener('click', (ev) => {
ev.preventDefault();
var params = getParams();
@@ -68,3 +72,6 @@ loadOptions().then((options) => {
copypasstoclippboard();
}
});
});