From 5202a69b64875c1ea29a677054931a346f7af430 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 file changed, 6 insertions(+), 1 deletion(-) 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 57d93c8259..8d07f9bac6 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') { -- 2.11.0