declare original_text

This commit is contained in:
Rachid Mrad 2024-11-26 12:35:10 -05:00
parent 4df17d7de0
commit 5ddffe18e2
No known key found for this signature in database

View file

@ -292,14 +292,14 @@ export function initCopyRequestSummary() {
buttonIcon.setAttribute('xlink:href', baseHref + '#check'); buttonIcon.setAttribute('xlink:href', baseHref + '#check');
// Change the button text // Change the button text
let nearestSpan = copyButton.querySelector("span") let nearestSpan = copyButton.querySelector("span");
original_text = nearestSpan.innerText let original_text = nearestSpan.innerText;
nearestSpan.innerText = "Copied to clipboard" nearestSpan.innerText = "Copied to clipboard";
setTimeout(function() { setTimeout(function() {
// Change back to the copy icon // Change back to the copy icon
buttonIcon.setAttribute('xlink:href', currentHref); buttonIcon.setAttribute('xlink:href', currentHref);
nearestSpan.innerText = original_text nearestSpan.innerText = original_text;
}, 2000); }, 2000);
} }