refactoring
This commit is contained in:
parent
f5f69139d5
commit
967ea50877
@ -362,24 +362,25 @@ if (navigator.userAgent.search("Firefox") >= 0) {
|
||||
document.querySelectorAll('[data-truncate]').forEach((truncate) => {
|
||||
let truncateText = truncate.innerText.split(" ").join("");
|
||||
|
||||
if (truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.clientWidth) {
|
||||
truncate.addEventListener('mouseover', function () {
|
||||
if (truncateText.length > 30) {
|
||||
truncate.style.animationPlayState = 'running';
|
||||
truncate.classList.add('animate-marquee');
|
||||
truncate.parentElement.style.animationPlayState = 'running';
|
||||
truncate.parentElement.classList.add('animate-marquee');
|
||||
|
||||
if (truncate.classList.contains('truncate')) {
|
||||
truncate.classList.remove('truncate');
|
||||
}
|
||||
}
|
||||
// if (truncate.parentElement.classList.contains('truncate')) {
|
||||
// truncate.parentElement.classList.remove('truncate');
|
||||
// }
|
||||
});
|
||||
|
||||
truncate.addEventListener('mouseout', function () {
|
||||
if (truncateText.length > 30) {
|
||||
truncate.style.animationPlayState = 'paused';
|
||||
truncate.classList.add('truncate');
|
||||
truncate.classList.remove('animate-marquee');
|
||||
}
|
||||
truncate.parentElement.style.animationPlayState = 'paused';
|
||||
truncate.parentElement.classList.remove('animate-marquee');
|
||||
truncate.parentElement.classList.add('truncate');
|
||||
});
|
||||
|
||||
truncate.classList.add('truncate');
|
||||
truncate.parentElement.classList.add('truncate');
|
||||
}
|
||||
});
|
||||
|
||||
//disable/enable icons ejected from data-truncate
|
||||
|
@ -84,7 +84,7 @@
|
||||
</x-table.td>
|
||||
|
||||
<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 }}
|
||||
|
||||
@if (! $item->enabled)
|
||||
|
@ -8,9 +8,11 @@
|
||||
}
|
||||
@endphp
|
||||
<div {{ $first_attributes }}>
|
||||
<x-marguee-text>
|
||||
<div>
|
||||
<span data-truncate>
|
||||
{!! $first !!}
|
||||
</x-marguee-text>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@ -23,13 +25,17 @@
|
||||
}
|
||||
@endphp
|
||||
<div {{ $second_attributes }}>
|
||||
<x-marguee-text>
|
||||
<div>
|
||||
<span data-truncate>
|
||||
{!! $second !!}
|
||||
</x-marguee-text>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<x-marguee-text>
|
||||
<div>
|
||||
<span data-truncate>
|
||||
{{ $slot }}
|
||||
</x-marguee-text>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -8,9 +8,7 @@
|
||||
}
|
||||
@endphp
|
||||
<div {{ $first_attributes }}>
|
||||
<x-marguee-text>
|
||||
{!! $first !!}
|
||||
</x-marguee-text>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@ -23,13 +21,9 @@
|
||||
}
|
||||
@endphp
|
||||
<div {{ $second_attributes }}>
|
||||
<x-marguee-text>
|
||||
{!! $second !!}
|
||||
</x-marguee-text>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<x-marguee-text>
|
||||
{{ $slot }}
|
||||
</x-marguee-text>
|
||||
</th>
|
||||
|
Loading…
x
Reference in New Issue
Block a user