added condition

This commit is contained in:
Burak Civan 2022-11-14 11:59:16 +03:00
parent 15e2c71f47
commit cb1ac3e789

View File

@ -446,6 +446,7 @@ 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 (title_truncate !== null) {
if (first.clientWidth < title_truncate.clientWidth) {
// added specific width styling for truncate text
title_truncate.style.width = first.clientWidth + 'px';
@ -474,6 +475,7 @@ document.querySelectorAll('[data-page-title-first]').forEach((first) => {
});
// added truncate animation for truncated text
}
}
// remove width class name for extend the right side
first.classList.remove('w-full', 'sm:w-6/12');