From af92af5a78a22a1ca9485457227eb7f29df2b94d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 5 Nov 2018 10:52:17 -0500 Subject: [PATCH] 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 Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton --- .../src/templates/staff/share/t_autogrid.tt2 | 5 +-- .../web/js/ui/default/staff/services/grid.js | 31 +------------------ 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index 19862d4d48..4d90a48408 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 @@ 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 cf29360291..9ee646a47c 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); } /** -- 2.43.2