refactoring
This commit is contained in:
parent
f5f69139d5
commit
967ea50877
@ -99,7 +99,7 @@ function expandSub(key, event) {
|
|||||||
//collapse accordion
|
//collapse accordion
|
||||||
|
|
||||||
// run dropdown and tooltip functions for Virtual DOM
|
// run dropdown and tooltip functions for Virtual DOM
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const triggers = [
|
const triggers = [
|
||||||
{ event: "mouseover", checker: isHoverable },
|
{ event: "mouseover", checker: isHoverable },
|
||||||
{ event: "mouseout", checker: isHoverable },
|
{ event: "mouseout", checker: isHoverable },
|
||||||
@ -361,25 +361,26 @@ if (navigator.userAgent.search("Firefox") >= 0) {
|
|||||||
//margue animation for truncated text
|
//margue animation for truncated text
|
||||||
document.querySelectorAll('[data-truncate]').forEach((truncate) => {
|
document.querySelectorAll('[data-truncate]').forEach((truncate) => {
|
||||||
let truncateText = truncate.innerText.split(" ").join("");
|
let truncateText = truncate.innerText.split(" ").join("");
|
||||||
|
|
||||||
|
if (truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.clientWidth) {
|
||||||
|
truncate.addEventListener('mouseover', function () {
|
||||||
|
truncate.parentElement.style.animationPlayState = 'running';
|
||||||
|
truncate.parentElement.classList.add('animate-marquee');
|
||||||
|
|
||||||
truncate.addEventListener('mouseover', function () {
|
// if (truncate.parentElement.classList.contains('truncate')) {
|
||||||
if (truncateText.length > 30) {
|
// truncate.parentElement.classList.remove('truncate');
|
||||||
truncate.style.animationPlayState = 'running';
|
// }
|
||||||
truncate.classList.add('animate-marquee');
|
});
|
||||||
|
|
||||||
|
truncate.addEventListener('mouseout', function () {
|
||||||
|
truncate.parentElement.style.animationPlayState = 'paused';
|
||||||
|
truncate.parentElement.classList.remove('animate-marquee');
|
||||||
|
truncate.parentElement.classList.add('truncate');
|
||||||
|
});
|
||||||
|
|
||||||
if (truncate.classList.contains('truncate')) {
|
truncate.classList.add('truncate');
|
||||||
truncate.classList.remove('truncate');
|
truncate.parentElement.classList.add('truncate');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
truncate.addEventListener('mouseout', function () {
|
|
||||||
if (truncateText.length > 30) {
|
|
||||||
truncate.style.animationPlayState = 'paused';
|
|
||||||
truncate.classList.add('truncate');
|
|
||||||
truncate.classList.remove('animate-marquee');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//disable/enable icons ejected from data-truncate
|
//disable/enable icons ejected from data-truncate
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</x-table.td>
|
</x-table.td>
|
||||||
|
|
||||||
<x-table.td class="w-6/12 sm:w-4/12">
|
<x-table.td class="w-6/12 sm:w-4/12">
|
||||||
<x-slot name="first" class="flex items-center font-bold" override="class">
|
<x-slot name="first" class="font-bold" override="class">
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
|
|
||||||
@if (! $item->enabled)
|
@if (! $item->enabled)
|
||||||
|
@ -8,9 +8,11 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $first_attributes }}>
|
<div {{ $first_attributes }}>
|
||||||
<x-marguee-text>
|
<div>
|
||||||
{!! $first !!}
|
<span data-truncate>
|
||||||
</x-marguee-text>
|
{!! $first !!}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -23,13 +25,17 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $second_attributes }}>
|
<div {{ $second_attributes }}>
|
||||||
<x-marguee-text>
|
<div>
|
||||||
{!! $second !!}
|
<span data-truncate>
|
||||||
</x-marguee-text>
|
{!! $second !!}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<x-marguee-text>
|
<div>
|
||||||
{{ $slot }}
|
<span data-truncate>
|
||||||
</x-marguee-text>
|
{{ $slot }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -8,9 +8,7 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $first_attributes }}>
|
<div {{ $first_attributes }}>
|
||||||
<x-marguee-text>
|
{!! $first !!}
|
||||||
{!! $first !!}
|
|
||||||
</x-marguee-text>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -23,13 +21,9 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $second_attributes }}>
|
<div {{ $second_attributes }}>
|
||||||
<x-marguee-text>
|
{!! $second !!}
|
||||||
{!! $second !!}
|
|
||||||
</x-marguee-text>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<x-marguee-text>
|
{{ $slot }}
|
||||||
{{ $slot }}
|
|
||||||
</x-marguee-text>
|
|
||||||
</th>
|
</th>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user