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

show notification when button pressed too

This commit is contained in:
s2
2017-11-22 10:27:58 +01:00
parent 5959bc4cbe
commit fee9b6b20a

View File

@@ -42,10 +42,12 @@ function copypasstoclippboard(cb) {
if (typeof(cb) === 'function') {
cb();
}
fade(document.getElementById('copied'));
}, 200);
}
function fade(element) {
element.style.display = 'block';
var op = 1; // initial opacity
var timer = setInterval(function () {
if (op <= 0.1) {
@@ -84,11 +86,7 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('pw').value = randPassword(getParams().length, getParams().special);
if (options.directcopy) {
copypasstoclippboard(() => {
let copied = document.getElementById('copied');
copied.style.display = 'block';
fade(copied)
});
copypasstoclippboard();
}
});