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 <gmc@equinoxOLI.org>
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
// 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') {