From 90bbf1942c840c1d6749732f52b955af0f1642c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Sun, 19 Oct 2025 10:16:15 +0200 Subject: [PATCH] activity note added deticated button for copy --- .../js/Pages/Cases/Partials/ActivityTable.vue | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/resources/js/Pages/Cases/Partials/ActivityTable.vue b/resources/js/Pages/Cases/Partials/ActivityTable.vue index ef014be..ac81d3b 100644 --- a/resources/js/Pages/Cases/Partials/ActivityTable.vue +++ b/resources/js/Pages/Cases/Partials/ActivityTable.vue @@ -7,9 +7,9 @@ import SecondaryButton from "@/Components/SecondaryButton.vue"; import DangerButton from "@/Components/DangerButton.vue"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { library } from "@fortawesome/fontawesome-svg-core"; -import { faTrash, faEllipsisVertical } from "@fortawesome/free-solid-svg-icons"; +import { faTrash, faEllipsisVertical, faCopy } from "@fortawesome/free-solid-svg-icons"; -library.add(faTrash, faEllipsisVertical); +library.add(faTrash, faEllipsisVertical, faCopy); const props = defineProps({ client_case: Object, @@ -83,6 +83,22 @@ const confirmDeleteAction = () => { confirmDelete.value = false; toDeleteRow.value = null; }; + +// Copy function +const copyToClipboard = async (text) => { + try { + await navigator.clipboard.writeText(text); + // You could add a toast notification here if available + } catch (err) { + // Fallback for older browsers + const textArea = document.createElement('textarea'); + textArea.value = text; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + } +};