From: Bill Erickson Date: Tue, 6 Nov 2018 14:42:17 +0000 (-0500) Subject: LP#1797007 Grid cell tooltips apply to all cells (Ang) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=625d31295a0db59fbe7150a500a0c34a3cbac42b;p=working%2FEvergreen.git LP#1797007 Grid cell tooltips apply to all cells (Ang) Avoid excessive browser page re-flows, caused by checking cell widths for rendering tooltips, by rendering tooltips for all cells regardless of the size of the content. Signed-off-by: Bill Erickson Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html index 3de90e41aa..578bef5e9c 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html @@ -1,6 +1,6 @@ @@ -8,7 +8,7 @@ ; constructor( private elm: ElementRef ) {} ngOnInit() {} - - ngAfterContentChecked() { - this.setTooltip(); - } - - // Returns true if the contents of this cell exceed the - // boundaries of its container. - cellOverflows(): boolean { - let node = this.elm.nativeElement; - if (node) { - node = node.parentNode; - return node && ( - node.scrollHeight > node.clientHeight || - node.scrollWidth > node.clientWidth - ); - } - return false; - } - - // Tooltips are only applied to cells whose contents exceed - // their container. - // Applying an empty string value prevents a tooltip from rendering. - setTooltip() { - if (this.cellOverflows()) { - this.tooltipContent = this.column.cellTemplate || - this.context.getRowColumnValue(this.row, this.column); - } else { - // No tooltip - this.tooltipContent = ''; - } - } }