From: Cesar Velez Date: Thu, 20 Jul 2017 15:02:12 +0000 (-0400) Subject: LP#1705286 - webstaff Prevent View holds grid being refreshed too often X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fcesardv%2FLP1705286_webstaff_ViewHolds_grid_refresh;p=working%2FEvergreen.git LP#1705286 - webstaff Prevent View holds grid being refreshed too often This is attempting to prevent un-necessary calls to refresh the holds grid, and prevent duplicates. Signed-off by: Cesar Velez --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index e71f74f6b0..9b9b018fbb 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -1556,6 +1556,9 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e // refresh the list of record holds when the pickup lib is changed. $scope.pickup_ou = egCore.org.get(egCore.auth.user().ws_ou()); $scope.pickup_ou_changed = function(org) { + // avoid refreshing if nothing changed or just loading eg-org-selector. + if ($scope.pickup_ou == org) return; + $scope.pickup_ou = org; provider.refresh(); } @@ -1663,9 +1666,10 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e break; case 'holds': - $scope.detail_hold_record_id = $scope.record_id; - // refresh the holds grid - provider.refresh(); + if ($scope.detail_hold_record_id != $scope.record_id){ + $scope.detail_hold_record_id = $scope.record_id; + provider.refresh(); + } break; }