refactoring

This commit is contained in:
Burak Civan 2022-10-24 14:39:10 +03:00
parent 9879358138
commit ec46f8b12e
2 changed files with 15 additions and 2 deletions

View File

@ -393,6 +393,19 @@ function marqueeAnimation(truncate) {
truncate.classList.add('truncate'); truncate.classList.add('truncate');
// if truncate has truncate class, text marquee animate doesn't pretty work
if (truncate.querySelector('.truncate') !== null && truncate.querySelector('.truncate').classList.contains('truncate')) {
let old_element = truncate.querySelector('.truncate');
let parent = old_element.parentNode;
let new_element = document.createElement('span');
new_element.innerHTML = old_element.innerHTML;
new_element.classList = old_element.classList;
parent.replaceChild(new_element, old_element);
}
// if truncate has truncate class, text marquee animate doesn't pretty work
// There needs to be two div for disable/enable icons. If I don't create this div, animation will work with disable/enable icons.--> // There needs to be two div for disable/enable icons. If I don't create this div, animation will work with disable/enable icons.-->
let animate_element = document.createElement('div'); let animate_element = document.createElement('div');
animate_element.classList.add('truncate'); animate_element.classList.add('truncate');

View File

@ -58,9 +58,9 @@
<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 font-bold" override="class"> <x-slot name="first" class="flex font-bold" override="class">
<span class="font-bold truncate"> <div class="font-bold truncate">
{{ $item->name }} {{ $item->name }}
</span> </div>
@if (! $item->enabled) @if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.currencies', 1) }}" /> <x-index.disable text="{{ trans_choice('general.currencies', 1) }}" />