added condition
This commit is contained in:
parent
15e2c71f47
commit
cb1ac3e789
52
public/akaunting-js/generalAction.js
vendored
52
public/akaunting-js/generalAction.js
vendored
@ -446,33 +446,35 @@ document.querySelectorAll('[data-page-title-first]').forEach((first) => {
|
||||
document.querySelectorAll('[data-page-title-second]').forEach((second) => {
|
||||
let title_truncate = first.querySelector('[data-title-truncate]');
|
||||
|
||||
if (first.clientWidth < title_truncate.clientWidth) {
|
||||
// added specific width styling for truncate text
|
||||
title_truncate.style.width = first.clientWidth + 'px';
|
||||
let subtract = title_truncate.clientWidth - 40;
|
||||
title_truncate.style.width = subtract + 'px';
|
||||
title_truncate.classList.add('truncate');
|
||||
// added specific width styling for truncate text
|
||||
|
||||
// added specific width styling into the parent title element for truncate text
|
||||
first.classList.add('w-full', 'sm:w-6/12');
|
||||
// added specific width styling into the parent title element for truncate text
|
||||
|
||||
title_truncate.parentNode.classList.add('overflow-x-hidden', 'hide-scroll-bar');
|
||||
if (title_truncate !== null) {
|
||||
if (first.clientWidth < title_truncate.clientWidth) {
|
||||
// added specific width styling for truncate text
|
||||
title_truncate.style.width = first.clientWidth + 'px';
|
||||
let subtract = title_truncate.clientWidth - 40;
|
||||
title_truncate.style.width = subtract + 'px';
|
||||
title_truncate.classList.add('truncate');
|
||||
// added specific width styling for truncate text
|
||||
|
||||
// added truncate animation for truncated text
|
||||
title_truncate.addEventListener('mouseover', function () {
|
||||
this.classList.add('animate-marquee');
|
||||
this.classList.remove('truncate');
|
||||
this.style.animationPlayState = 'running';
|
||||
});
|
||||
// added specific width styling into the parent title element for truncate text
|
||||
first.classList.add('w-full', 'sm:w-6/12');
|
||||
// added specific width styling into the parent title element for truncate text
|
||||
|
||||
title_truncate.addEventListener('mouseout', function () {
|
||||
this.style.animationPlayState = 'paused';
|
||||
this.classList.remove('animate-marquee');
|
||||
this.classList.add('truncate');
|
||||
});
|
||||
// added truncate animation for truncated text
|
||||
title_truncate.parentNode.classList.add('overflow-x-hidden', 'hide-scroll-bar');
|
||||
|
||||
// added truncate animation for truncated text
|
||||
title_truncate.addEventListener('mouseover', function () {
|
||||
this.classList.add('animate-marquee');
|
||||
this.classList.remove('truncate');
|
||||
this.style.animationPlayState = 'running';
|
||||
});
|
||||
|
||||
title_truncate.addEventListener('mouseout', function () {
|
||||
this.style.animationPlayState = 'paused';
|
||||
this.classList.remove('animate-marquee');
|
||||
this.classList.add('truncate');
|
||||
});
|
||||
// added truncate animation for truncated text
|
||||
}
|
||||
}
|
||||
|
||||
// remove width class name for extend the right side
|
||||
|
Loading…
x
Reference in New Issue
Block a user