diff --git a/app/View/Components/DeleteLink.php b/app/View/Components/DeleteLink.php index 52c9cdee7..f098768eb 100644 --- a/app/View/Components/DeleteLink.php +++ b/app/View/Components/DeleteLink.php @@ -282,7 +282,7 @@ class DeleteLink extends Component protected function getClass($class) { - $default_class = 'w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap'; + $default_class = 'w-full flex items-center text-red sm:text-purple px-2 h-9 leading-9 whitespace-nowrap'; $explode = explode(',', $this->override); diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index 9129c8ba0..a3424c6a5 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -11,7 +11,7 @@ document.querySelectorAll("[data-table-list]").forEach((row) => { //redirect edit or show page for table row click document.querySelectorAll("[data-table-body]").forEach((table) => { - if (document.body.clientWidth >= 991) { + if (document.body.clientWidth < 768 || document.body.clientWidth > 1200) { let rows = table.querySelectorAll("tr"); rows.forEach((row) => { @@ -27,7 +27,13 @@ document.querySelectorAll("[data-table-body]").forEach((table) => { if (row_href) { for (let i = first_selector; i < td.length - 1; i++) { let td_item = td[i]; - td_item.addEventListener("click", () => { + + td_item.addEventListener("click", (event) => { + // click disabled when preview dialog is open + if (event.target.closest('[data-tooltip-target]')) { + return; + } + // click disabled when preview dialog is open window.location.href = row_href; }); @@ -42,6 +48,20 @@ document.querySelectorAll("[data-table-body]").forEach((table) => { } }); } + + if (document.body.clientWidth <= 768) { + table.querySelectorAll('[data-table-list]').forEach((actions) => { + actions.querySelector('[data-mobile-actions]').addEventListener('click', function() { + this.closest('td').querySelector('[data-mobile-actions-modal]').classList.add('show'); + this.closest('td').querySelector('[data-mobile-actions-modal]').classList.remove('opacity-0', 'invisible'); + + this.closest('td').querySelector('[data-mobile-actions-modal]').addEventListener('click', function() { + this.classList.add('opacity-0', 'invisible'); + this.classList.remove('show'); + }); + }); + }); + } }); //redirect edit or show page for table row click diff --git a/public/css/app.css b/public/css/app.css index e953b3f3b..f51fdbdc0 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -54501,16 +54501,16 @@ body{ background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.hover\:bg-gray-100:hover{ - --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); -} - .hover\:bg-lilac-100:hover{ --tw-bg-opacity: 1; background-color: rgb(245 247 250 / var(--tw-bg-opacity)); } +.hover\:bg-gray-100:hover{ + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + .hover\:bg-gray-200:hover{ --tw-bg-opacity: 1; background-color: rgb(229 231 235 / var(--tw-bg-opacity)); @@ -57060,6 +57060,11 @@ body{ line-height: 2.75rem; } + .sm\:text-purple{ + --tw-text-opacity: 1; + color: rgb(85 88 139 / var(--tw-text-opacity)); + } + [dir="ltr"] .sm\:ltr\:right-4{ right: 1rem; } diff --git a/resources/views/components/delete-button.blade.php b/resources/views/components/delete-button.blade.php index e7e3333b7..50d161f3b 100644 --- a/resources/views/components/delete-button.blade.php +++ b/resources/views/components/delete-button.blade.php @@ -1,10 +1,26 @@ - + + @if ($slot->isNotEmpty()) + {!! $slot !!} + @else + {!! $label !!} + @endif +@else + diff --git a/resources/views/components/table/actions-mobile.blade.php b/resources/views/components/table/actions-mobile.blade.php new file mode 100644 index 000000000..186103d6d --- /dev/null +++ b/resources/views/components/table/actions-mobile.blade.php @@ -0,0 +1,150 @@ +@php + $count_buttons = 1; + $more_actions = []; +@endphp + +
+ + more_horiz + +
+ + \ No newline at end of file diff --git a/resources/views/components/table/actions.blade.php b/resources/views/components/table/actions.blade.php index 8ce6cd0cf..639303fc4 100644 --- a/resources/views/components/table/actions.blade.php +++ b/resources/views/components/table/actions.blade.php @@ -3,132 +3,136 @@ $more_actions = []; @endphp -