From e4579ed779a8575337f2bfc974ec92522037d17b Mon Sep 17 00:00:00 2001 From: Anoop Kumar Date: Wed, 27 Dec 2023 23:27:40 +0400 Subject: [PATCH] Fix: clipboard button not working Resolved issue with non-functional clipboard button on homepage. Signed-off-by: Anoop Kumar --- content/fedora.md | 13 ------------- layouts/partials/footer.html | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/content/fedora.md b/content/fedora.md index 2fa89d0..bf6d2a7 100644 --- a/content/fedora.md +++ b/content/fedora.md @@ -242,18 +242,5 @@ document.addEventListener("DOMContentLoaded", function() { e.preventDefault(); }; }); - var btn = document.getElementById("copy-button"); - btn.onmouseover = function(e) { - btn.firstChild.classList.remove("fa-check"); - btn.firstChild.classList.add("fa-clipboard"); - } - btn.onclick = function(e) { - var text = document.getElementById("curl"); - window.getSelection().selectAllChildren(text); - navigator.clipboard.writeText(text.textContent); - btn.firstChild.classList.add("fa-check"); - btn.firstChild.classList.remove("fa-clipboard"); - e.preventDefault(); - }; }); diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 888c2b2..4c735e7 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -21,5 +21,21 @@ + +