code refactoring
This commit is contained in:
parent
f84c0801b9
commit
41b933143b
5
public/akaunting-js/generalAction.js
vendored
5
public/akaunting-js/generalAction.js
vendored
@ -366,7 +366,7 @@ function marqueeAnimation(truncate) {
|
|||||||
}
|
}
|
||||||
// offsetwidth = width of the text, clientWidth = width of parent text (div)
|
// offsetwidth = width of the text, clientWidth = width of parent text (div)
|
||||||
// because some index page has icons, we use two time parent element
|
// because some index page has icons, we use two time parent element
|
||||||
if (truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.clientWidth) {
|
if (truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.parentElement.clientWidth) {
|
||||||
truncate.addEventListener('mouseover', function () {
|
truncate.addEventListener('mouseover', function () {
|
||||||
truncate.parentElement.style.animationPlayState = 'running';
|
truncate.parentElement.style.animationPlayState = 'running';
|
||||||
truncate.parentElement.classList.add('animate-marquee');
|
truncate.parentElement.classList.add('animate-marquee');
|
||||||
@ -384,6 +384,7 @@ function marqueeAnimation(truncate) {
|
|||||||
|
|
||||||
truncate.classList.add('truncate');
|
truncate.classList.add('truncate');
|
||||||
truncate.parentElement.classList.add('truncate');
|
truncate.parentElement.classList.add('truncate');
|
||||||
|
truncate.parentElement.parentElement.classList.add('overflow-x-hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +394,7 @@ document.querySelectorAll('[data-truncate]').forEach((truncate) => {
|
|||||||
|
|
||||||
//disable/enable icons ejected from data-truncate, HTML of icons ejected from parent element (data-truncate)
|
//disable/enable icons ejected from data-truncate, HTML of icons ejected from parent element (data-truncate)
|
||||||
document.querySelectorAll('[data-index-icon]').forEach((defaultText) => {
|
document.querySelectorAll('[data-index-icon]').forEach((defaultText) => {
|
||||||
defaultText.parentElement.parentElement.parentElement.appendChild(defaultText);
|
defaultText.parentElement.parentElement.parentElement.parentElement.appendChild(defaultText);
|
||||||
});
|
});
|
||||||
//disable/enable icons ejected from data-truncate
|
//disable/enable icons ejected from data-truncate
|
||||||
|
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $first_attributes }}>
|
<div {{ $first_attributes }}>
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{!! $first !!}
|
{!! $first !!}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (!empty($second))
|
@if (!empty($second))
|
||||||
@ -25,17 +27,21 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $second_attributes }}>
|
<div {{ $second_attributes }}>
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{!! $second !!}
|
{!! $second !!}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $first_attributes }}>
|
<div {{ $first_attributes }}>
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{!! $first !!}
|
{!! $first !!}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (!empty($second))
|
@if (!empty($second))
|
||||||
@ -25,17 +27,21 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div {{ $second_attributes }}>
|
<div {{ $second_attributes }}>
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{!! $second !!}
|
{!! $second !!}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span data-truncate>
|
<span data-truncate>
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user