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:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user