From 6679e6bac0ba0fb5b25af09fe898ecb355bf0f71 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 28 Mar 2023 11:37:44 +0300 Subject: [PATCH] restrict result title in 3 rows for search page and 5 rows for landing page (included tooltip for landing) --- .../landing-utils/showTitle.component.ts | 81 ++++++++++--------- .../result-preview.component.html | 24 +++--- 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/landingPages/landing-utils/showTitle.component.ts b/landingPages/landing-utils/showTitle.component.ts index dd688386..02025e65 100644 --- a/landingPages/landing-utils/showTitle.component.ts +++ b/landingPages/landing-utils/showTitle.component.ts @@ -1,52 +1,55 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; +import {Component, ElementRef, Input, ViewChild} from '@angular/core'; @Component({ - selector: 'showTitle', - template: ` -

- -

- -
- - - - - [no title available] - - - - - - [no title available] - -
-
- -
-
- No title available -
-
- ` + selector: 'showTitle', + template: ` +

+ +

- }) + +
+ + + + + [no title available] + + + + + + [no title available] + +
+
+ +
+
+ No title available +
+
+ ` +}) export class ShowTitleComponent { @Input() titleName: string; @Input() title: { [key: string]: string }; @Input() iconClass:string; @Input() classNames: string = ""; + @ViewChild("titleDiv") titleDiv: ElementRef; constructor () {} + get showTitleTooltip():boolean { + return !!this.titleDiv && (this.titleDiv.nativeElement.clientHeight >= 5 * 21); + } } diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index ecf40866..86538ab0 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -19,14 +19,14 @@
-
+