Skip to content

Commit ada5d2f

Browse files
authored
Reset the docs' copy path button after 1 second
1 parent a45f0d7 commit ada5d2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustdoc/html/static/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,8 @@ function hideThemeButtonState() {
14901490
searchState.setup();
14911491
}());
14921492

1493+
let reset_button_timeout;
1494+
14931495
function copy_path(but) {
14941496
var parent = but.parentElement;
14951497
var path = [];
@@ -1513,4 +1515,12 @@ function copy_path(but) {
15131515
document.body.removeChild(el);
15141516

15151517
but.textContent = '✓';
1518+
1519+
window.clearTimeout(reset_button_timeout);
1520+
1521+
function reset_button() {
1522+
but.textContent = '⎘';
1523+
}
1524+
1525+
reset_button_timeout = window.setTimeout(reset_button, 1000);
15161526
}

0 commit comments

Comments
 (0)