From d5706c6f07bb4ccf9296c7f51f95dc63c035963e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 29 Mar 2023 12:09:32 -0400 Subject: [PATCH] LP#2013223: quiet browser console noise from some AngularJS grids This patch quells console error noise from certain AngularJS grids. To test ------- [1] Go to the AngularJS Renew Items, Holds Shelf, or patron holds list pages. [2] Note that the brower console has a lot of "TypeError: action.handler is undefined" error messages. [3] Apply the patch and repeat step 1. This time, the "action.handler" errors should be gone. Signed-off-by: Galen Charlton Signed-off-by: Stephanie Leary Signed-off-by: Jane Sandberg --- Open-ILS/web/js/ui/default/staff/services/grid.js | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) 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 57d93c8..8d07f9b 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -658,7 +658,12 @@ angular.module('egGridMod', // fires the disable handler function for a context action $scope.actionDisable = function(action) { - if(grid.getSelectedItems().length == 0 && action.handler.length > 0) { + if (!action.handler) { + // we're probably a divider, so there's no action + // to enable + return true; + } + if (grid.getSelectedItems().length == 0 && action.handler.length > 0) { return true; } if (typeof action.disabled == 'undefined') { -- 1.7.2.5