Fix: Back to normal state after the link being copied
This commit is contained in:
parent
1293f093d5
commit
5c42ff6851
@ -1,12 +1,9 @@
|
|||||||
// Inicializar Clipboard.js
|
|
||||||
const clipboard = new ClipboardJS(".clipboard");
|
const clipboard = new ClipboardJS(".clipboard");
|
||||||
|
|
||||||
// Manejar el evento de éxito
|
|
||||||
clipboard.on("success", function (e) {
|
clipboard.on("success", function (e) {
|
||||||
const clipboardDiv = e.trigger;
|
const clipboardDiv = e.trigger;
|
||||||
|
|
||||||
// Cambiar el fondo y el color del texto
|
clipboardDiv.classList.remove("hover:bg-gray-100");
|
||||||
clipboardDiv.classList.remove("bg-white", "hover:bg-gray-100");
|
|
||||||
clipboardDiv.classList.add("bg-green-100");
|
clipboardDiv.classList.add("bg-green-100");
|
||||||
|
|
||||||
// Mostrar mensaje
|
// Mostrar mensaje
|
||||||
@ -17,6 +14,7 @@ clipboard.on("success", function (e) {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
feedback.classList.add("hidden");
|
feedback.classList.add("hidden");
|
||||||
clipboardDiv.classList.remove("bg-green-100");
|
clipboardDiv.classList.remove("bg-green-100");
|
||||||
|
clipboardDiv.classList.add("hover:bg-gray-100");
|
||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user