about summary refs log tree commit diff
diff options
context:
space:
mode:
authorr00ster <r00ster91@protonmail.com>2021-04-30 10:18:14 +0200
committerGitHub <noreply@github.com>2021-04-30 10:18:14 +0200
commitada5d2f9dc0198226e8566fb06a04b2f8d09b3d3 (patch)
treeed519f1f28f6223fccd1cb2f526397ec9b02dbb3
parenta45f0d724ed7116ed475fb0d628bc118418e7cbf (diff)
downloadrust-ada5d2f9dc0198226e8566fb06a04b2f8d09b3d3.tar.gz
rust-ada5d2f9dc0198226e8566fb06a04b2f8d09b3d3.zip
Reset the docs' copy path button after 1 second
-rw-r--r--src/librustdoc/html/static/main.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 95b18490641..772a63c86b8 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -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);
 }