LP#1697954 Notify correct page of patron holds
authorMike Rylander <mrylander@gmail.com>
Thu, 22 Jun 2017 16:09:26 +0000 (12:09 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 30 Jun 2017 14:44:29 +0000 (10:44 -0400)
Instead of notifying the grid on all holds, just notify when we're inside
the current page of results.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/circ/patron/holds.js

index e2c422b..1e51cde 100644 (file)
@@ -83,6 +83,7 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
         if ($scope.holds_display == 'alt')
             method = 'open-ils.circ.holds.canceled.id_list.retrieve.authoritative';
 
+        var current = 0;
         egCore.net.request(
             'open-ils.circ', method,
             egCore.auth.token(), $scope.patron_id
@@ -92,7 +93,14 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
 
             patronSvc.hold_ids = hold_ids;
             fetchHolds(offset, count)
-            .then(deferred.resolve, null, deferred.notify);
+            .then(deferred.resolve, null, function (data) {
+                if (data) {
+                    if (current >= offset && current < count) {
+                        deferred.notify(data);
+                    }
+                    current++;
+                }
+            });
         });
 
         return deferred.promise;