truncate html created only truncated text
This commit is contained in:
parent
d9218eff7f
commit
f5f69139d5
4
public/akaunting-js/generalAction.js
vendored
4
public/akaunting-js/generalAction.js
vendored
@ -362,10 +362,6 @@ if (navigator.userAgent.search("Firefox") >= 0) {
|
|||||||
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 (truncateText.length > 30) {
|
|
||||||
truncate.classList.add('truncate');
|
|
||||||
}
|
|
||||||
|
|
||||||
truncate.addEventListener('mouseover', function () {
|
truncate.addEventListener('mouseover', function () {
|
||||||
if (truncateText.length > 30) {
|
if (truncateText.length > 30) {
|
||||||
truncate.style.animationPlayState = 'running';
|
truncate.style.animationPlayState = 'running';
|
||||||
|
@ -1,8 +1,21 @@
|
|||||||
|
@php
|
||||||
|
$slot_text_length = strlen($slot);
|
||||||
|
|
||||||
|
$slot_isHtml = strlen(strip_tags($slot)) < strlen($slot);
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if ($slot_text_length >= '30' && ! $slot_isHtml)
|
||||||
<div data-truncate-parent class="flex lg:block truncate">
|
<div data-truncate-parent class="flex lg:block truncate">
|
||||||
<div
|
<div
|
||||||
@class([ $width ])
|
@class([
|
||||||
|
$width,
|
||||||
|
'truncate',
|
||||||
|
])
|
||||||
data-truncate
|
data-truncate
|
||||||
>
|
>
|
||||||
{!! $slot !!}
|
{!! $slot !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@else
|
||||||
|
{!! $slot !!}
|
||||||
|
@endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user