webstaff: Allow jumping between pages
authorMike Rylander <mrylander@gmail.com>
Thu, 18 May 2017 16:23:57 +0000 (12:23 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 30 May 2017 16:06:46 +0000 (12:06 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/serials/directives/view-items-grid.js

index c584bf8..0aaf680 100644 (file)
@@ -44,7 +44,12 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider ,
             if (egSerialsCoreSvc.itemList.length >= offset + count) { // if there's anything on the requested page, notify
                 return self.arrayNotifier(egSerialsCoreSvc.itemList, offset, count);
             } else { // else try to fetch another page
-                return egSerialsCoreSvc.fetchItemsForSubPaged($scope.ssubId, _paging_filter, offset, count).then(function() {
+                return egSerialsCoreSvc.fetchItemsForSubPaged(
+                    $scope.ssubId,
+                    _paging_filter,
+                    egSerialsCoreSvc.itemList.length,
+                    count + offset - egSerialsCoreSvc.itemList.length
+                ).then(function() {
                     return self.arrayNotifier(egSerialsCoreSvc.itemList, offset, count);
                 });
             }