Reset the docs' copy path button after 1 second

This commit is contained in:
r00ster 2021-04-30 10:18:14 +02:00 committed by GitHub
parent a45f0d724e
commit ada5d2f9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1490,6 +1490,8 @@ function hideThemeButtonState() {
searchState.setup();
}());
let reset_button_timeout;
function copy_path(but) {
var parent = but.parentElement;
var path = [];
@ -1513,4 +1515,12 @@ function copy_path(but) {
document.body.removeChild(el);
but.textContent = '✓';
window.clearTimeout(reset_button_timeout);
function reset_button() {
but.textContent = '⎘';
}
reset_button_timeout = window.setTimeout(reset_button, 1000);
}