Skip to content

Commit e4579ed

Browse files
committed
Fix: clipboard button not working
Resolved issue with non-functional clipboard button on homepage. Signed-off-by: Anoop Kumar <[email protected]>
1 parent f2f936d commit e4579ed

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

content/fedora.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,5 @@ document.addEventListener("DOMContentLoaded", function() {
242242
e.preventDefault();
243243
};
244244
});
245-
var btn = document.getElementById("copy-button");
246-
btn.onmouseover = function(e) {
247-
btn.firstChild.classList.remove("fa-check");
248-
btn.firstChild.classList.add("fa-clipboard");
249-
}
250-
btn.onclick = function(e) {
251-
var text = document.getElementById("curl");
252-
window.getSelection().selectAllChildren(text);
253-
navigator.clipboard.writeText(text.textContent);
254-
btn.firstChild.classList.add("fa-check");
255-
btn.firstChild.classList.remove("fa-clipboard");
256-
e.preventDefault();
257-
};
258245
});
259246
</script>

layouts/partials/footer.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,21 @@
2121
</div>
2222
</div>
2323
</footer>
24+
<!-- JavaScript code -->
25+
<script>
26+
var btn = document.getElementById("copy-button");
27+
btn.onmouseover = function(e) {
28+
btn.firstChild.classList.remove("fa-check");
29+
btn.firstChild.classList.add("fa-clipboard");
30+
}
31+
btn.onclick = function(e) {
32+
var text = document.getElementById("curl");
33+
window.getSelection().selectAllChildren(text);
34+
navigator.clipboard.writeText(text.textContent);
35+
btn.firstChild.classList.add("fa-check");
36+
btn.firstChild.classList.remove("fa-clipboard");
37+
e.preventDefault();
38+
};
39+
</script>
2440
</body>
2541
</html>

0 commit comments

Comments
 (0)