From eeb3379e8077f44fc69ca9e2b5adfa2233c90624 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Mon, 14 Nov 2022 09:23:45 +0300 Subject: [PATCH] two column header controlled --- public/akaunting-js/generalAction.js | 36 +++++++++++++++++++ public/css/app.css | 3 ++ resources/assets/sass/app.css | 5 +++ .../components/layouts/admin/header.blade.php | 24 ++++++------- resources/views/components/title.blade.php | 10 +++--- .../views/livewire/menu/favorite.blade.php | 2 +- safelist.txt | 1 + 7 files changed, 62 insertions(+), 19 deletions(-) diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index cbf0431bc..73cade366 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -440,3 +440,39 @@ document.querySelectorAll('[data-index-icon]').forEach((defaultText) => { //disable/enable icons ejected from data-truncate-marquee //margue animation for truncated text + +document.querySelectorAll('[data-page-title-first]').forEach((first) => { + document.querySelectorAll('[data-page-title-second]').forEach((second) => { + let title_truncate = first.querySelector('[data-title-truncate]'); + + if (title_truncate !== null) { + if (title_truncate.clientWidth > first.clientWidth) { + title_truncate.style.width = first.clientWidth + 'px'; + let subtract = title_truncate.clientWidth - 40; + title_truncate.style.width = subtract + 'px'; + } + + if (second.clientHeight > 44) { + first.classList.add('w-full', 'sm:w-6/12'); + } else { + first.classList.remove('sm:w-6/12'); + } + + if (title_truncate.clientWidth > first.clientWidth) { + let marquee = first.querySelector('[data-title-truncate]'); + + marquee.addEventListener('mouseover', function () { + marquee.classList.add('animate-marquee'); + marquee.classList.remove('truncate'); + marquee.style.animationPlayState = 'running'; + }); + + marquee.addEventListener('mouseout', function () { + marquee.style.animationPlayState = 'paused'; + marquee.classList.remove('animate-marquee'); + marquee.classList.add('truncate'); + }); + } + } + }); +}); diff --git a/public/css/app.css b/public/css/app.css index 9fcc9e415..e89528355 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -53411,6 +53411,9 @@ button, input, optgroup, select, textarea{ border-bottom-left-radius: 0.5rem; border-right-width: 0px; } +.suggestion-buttons > a:first-child, .suggestion-buttons > button:first-child{ + margin-top: 0.5rem; +} [data-dropdown-actions] { -webkit-transform: unset !important; transform: unset !important; diff --git a/resources/assets/sass/app.css b/resources/assets/sass/app.css index a1c665be5..a6c484e43 100644 --- a/resources/assets/sass/app.css +++ b/resources/assets/sass/app.css @@ -21,6 +21,11 @@ .index-actions { @apply ltr:[&:nth-child(2)]:border-l ltr:[&:nth-child(3)]:border-l-0 rtl:[&:nth-child(2)]:border-r rtl:[&:nth-child(3)]:border-r-0 ltr:[&:first-child]:rounded-tl-lg ltr:[&:first-child]:rounded-bl-lg ltr:[&:first-child]:border-r-0 rtl:[&:first-child]:rounded-tr-lg rtl:[&:first-child]:rounded-br-lg rtl:[&:first-child]:border-l-0 ltr:[&:last-child]:rounded-tr-lg ltr:[&:last-child]:rounded-br-lg ltr:[&:last-child]:border-l-0 rtl:[&:last-child]:rounded-tl-lg rtl:[&:last-child]:rounded-bl-lg rtl:[&:last-child]:border-r-0; } + + .suggestion-buttons > a:first-child, .suggestion-buttons > button:first-child { + @apply mt-2; + } + [data-dropdown-actions] { transform: unset !important; } diff --git a/resources/views/components/layouts/admin/header.blade.php b/resources/views/components/layouts/admin/header.blade.php index 86f67f256..b92cb33b2 100644 --- a/resources/views/components/layouts/admin/header.blade.php +++ b/resources/views/components/layouts/admin/header.blade.php @@ -1,10 +1,10 @@ @stack('header_start') -