mirror of
https://github.com/S2-/pwgen.git
synced 2025-08-03 01:00:04 +02:00
add timeout before copying password
This commit is contained in:
@@ -35,11 +35,15 @@ function saveOptions(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copypasstoclippboard() {
|
function copypasstoclippboard() {
|
||||||
|
setTimeout(function() {
|
||||||
var copyText = document.getElementById('pw');
|
var copyText = document.getElementById('pw');
|
||||||
copyText.select();
|
copyText.select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
document.getElementById('new').addEventListener('click', (ev) => {
|
document.getElementById('new').addEventListener('click', (ev) => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
var params = getParams();
|
var params = getParams();
|
||||||
@@ -68,3 +72,6 @@ loadOptions().then((options) => {
|
|||||||
copypasstoclippboard();
|
copypasstoclippboard();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user