From ea7a40a75addaa8c9c563ef318c470a1b2f90d51 Mon Sep 17 00:00:00 2001 From: Sufiyan Shaikh Date: Fri, 27 May 2022 20:57:38 +0530 Subject: [PATCH] [DSC-516] Removed faded effect --- .../truncatable-part/truncatable-part.component.scss | 4 ++++ .../truncatable-part/truncatable-part.component.ts | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss index f67d343cd6..e778e1d15e 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss @@ -5,3 +5,7 @@ .btn:focus { box-shadow: none !important; } + +.removeFaded { + position: inherit; +} diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts index 22a0391629..e73823fa7e 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts @@ -108,14 +108,23 @@ export class TruncatablePartComponent implements AfterViewChecked, OnInit, OnDes if (entry.children.length > 0) { if (entry.children[entry.children.length - 1].offsetHeight > entry.offsetHeight) { entry.classList.add('truncated'); + entry.classList.remove('removeFaded'); } else { entry.classList.remove('truncated'); + entry.classList.add('removeFaded'); } } else { - entry.classList.add('truncated'); + if (entry.innerText.length > 0) { + entry.classList.add('truncated'); + entry.classList.remove('removeFaded'); + } else { + entry.classList.remove('truncated'); + entry.classList.add('removeFaded'); + } } } else { entry.classList.remove('truncated'); + entry.classList.add('removeFaded'); } }