[open-ils-commits] [GIT] Evergreen ILS branch master updated. 8fabb9ea5d360a5d03ec69c2e1f8fdc9c5cb4c25

Evergreen Git git at git.evergreen-ils.org
Thu Nov 15 10:57:03 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  8fabb9ea5d360a5d03ec69c2e1f8fdc9c5cb4c25 (commit)
       via  af92af5a78a22a1ca9485457227eb7f29df2b94d (commit)
      from  5e9132fb1407aa4d9962bdbe2a7dc3e811bc78d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8fabb9ea5d360a5d03ec69c2e1f8fdc9c5cb4c25
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Nov 6 09:42:17 2018 -0500

    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 <berickxx at gmail.com>
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

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 3de90e4..578bef5 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 @@
 
 <span *ngIf="!column.cellTemplate"
-  [ngbTooltip]="tooltipContent"
+  [ngbTooltip]="context.getRowColumnValue(row, column)"
   placement="top-left"
   class="{{context.cellClassCallback(row, column)}}"
   triggers="mouseenter:mouseleave">
@@ -8,7 +8,7 @@
 </span>
 <span *ngIf="column.cellTemplate" 
   class="{{context.cellClassCallback(row, column)}}"
-  [ngbTooltip]="tooltipContent"
+  [ngbTooltip]="column.cellTemplate"
   placement="top-left"
   #tooltip="ngbTooltip" 
   (mouseenter)="tooltip.open(column.getCellContext(row))"
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.ts
index 3d844f3..d1e88ba 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.ts
@@ -1,5 +1,5 @@
 import {Component, Input, OnInit, AfterViewInit,
-    TemplateRef, ElementRef, AfterContentChecked} from '@angular/core';
+    TemplateRef, ElementRef} from '@angular/core';
 import {GridContext, GridColumn, GridRowSelector,
     GridColumnSet, GridDataSource} from './grid';
 
@@ -8,50 +8,18 @@ import {GridContext, GridColumn, GridRowSelector,
   templateUrl: './grid-body-cell.component.html'
 })
 
-export class GridBodyCellComponent implements OnInit, AfterContentChecked {
+export class GridBodyCellComponent implements OnInit {
 
     @Input() context: GridContext;
     @Input() row: any;
     @Input() column: GridColumn;
 
     initDone: boolean;
-    tooltipContent: string | TemplateRef<any>;
 
     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 = '';
-        }
-    }
 }
 

commit af92af5a78a22a1ca9485457227eb7f29df2b94d
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Nov 5 10:52:17 2018 -0500

    LP#1797007 Grid cell tooltips apply to all cells
    
    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.
    
    This reverts commit 1e9c0ab388a0697a1f099970240f2da21bfb5e1f.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jason Boyer <JBoyer at library.in.gov>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
index 19862d4..4d90a48 100644
--- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2
+++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
@@ -329,7 +329,6 @@
           <!-- if the cell comes with its own template,
                translate that content into HTML and insert it here -->
           <span ng-if="col.template && !col.compiled" 
-            id="{{cellId(col, item)}}"
             style="padding-left:5px; padding-right:10px;">
             <span tooltip-class="eg-grid-tooltip"
               tooltip-class="eg-grid-tooltip"
@@ -346,9 +345,7 @@
           <!-- otherwise, simply display the item value, which may 
                pass through datatype-specific filtering. -->
           <span ng-if="!col.template" 
-            id="{{cellId(col, item)}}"
-            uib-tooltip="{{cellOverflowed(cellId(col, item), 1) ? (itemFieldValue(item, col) | egGridValueFilter:col:item) : ''}}"
-            tooltip-class="eg-grid-tooltip"
+            uib-tooltip="{{itemFieldValue(item, col) | egGridValueFilter:col:item}}"
             tooltip-placement="top-left"
             tooltip-class="eg-grid-tooltip"
             style="padding-left:5px; padding-right:10px;">
diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js
index cf29360..9ee646a 100644
--- a/Open-ILS/web/js/ui/default/staff/services/grid.js
+++ b/Open-ILS/web/js/ui/default/staff/services/grid.js
@@ -886,32 +886,6 @@ angular.module('egGridMod',
                 return grid.modifyColumnPos(col, diff);
             }
 
-            // Returns true of the contents of the cell overflow its container.
-            // parentDepth tells the code how far up the DOM tree to traverse
-            // via parentNode before stopping to inspect the value.
-            // There's no way to pass a reference to a DOM node directly via
-            // a scope function (except ng-click, etc.) so pass the 
-            // DOM id instead and get the node from there.
-            $scope.cellOverflowed = function(id, parentDepth) {
-                var node = document.getElementById(id);
-                if (!node) return;
-                for (var i = 0; i < parentDepth; i++) {
-                    node = node.parentNode;
-                }
-                return node.scrollHeight > node.clientHeight 
-                    || node.scrollWidth > node.clientWidth;
-            }
-
-            // Generates a unique identifier per cell per grid.
-            $scope.cellId = function(col, item) {
-                if (!col || !item) return '';
-                return 'grid-cell-span-' 
-                    // differentiate grids
-                    + ($scope.persistKey || $scope.idlClass || $scope.grid_element.id)
-                    // differentiate rows and columns.
-                    + '-' + col.name + '-' + $scope.indexValue(item);
-
-            }
 
             // handles click, control-click, and shift-click
             $scope.handleRowClick = function($event, item) {
@@ -1148,10 +1122,7 @@ angular.module('egGridMod',
             }
 
             $scope.getHtmlTooltip = function(col, item) {
-                if ($scope.cellOverflowed($scope.cellId(col, item), 1)) {
-                    return grid.getItemTextContent(item, col);
-                }
-                return "";
+                return grid.getItemTextContent(item, col);
             }
 
             /**

-----------------------------------------------------------------------

Summary of changes:
 .../app/share/grid/grid-body-cell.component.html   |    4 +-
 .../src/app/share/grid/grid-body-cell.component.ts |   36 +------------------
 Open-ILS/src/templates/staff/share/t_autogrid.tt2  |    5 +--
 Open-ILS/web/js/ui/default/staff/services/grid.js  |   31 +----------------
 4 files changed, 6 insertions(+), 70 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list