From: Galen Charlton Date: Wed, 29 Mar 2023 16:09:32 +0000 (-0400) Subject: LP#2013223: quiet browser console noise from some AngularJS grids X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=d5706c6f07bb4ccf9296c7f51f95dc63c035963e 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 --- 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') {