From 540637580ab3e39c0f9b0ca606a2f8971fc1a7c4 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Fri, 12 Feb 2016 18:54:24 +0100 Subject: [PATCH] makes smaller fetching batch --- webapp/js/views/recents/recents.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/js/views/recents/recents.js b/webapp/js/views/recents/recents.js index 2eb139a..b54bf01 100644 --- a/webapp/js/views/recents/recents.js +++ b/webapp/js/views/recents/recents.js @@ -24,13 +24,14 @@ angular.module('satbd.satellite.bar.views.recents',[ }); $scope.loadMore = function() { + var batchSize =20; $log.info('Loading more components'); if (!$scope.scrollMore || $scope.albumIDs.length >= $scope.allAlbums.length) { $scope.scrollMore = false; $log.info('reached the end of albums') return; } - var newSize = Math.min($scope.albumIDs.length + 50, $scope.allAlbums.length); + var newSize = Math.min($scope.albumIDs.length + batchSize, $scope.allAlbums.length); for( var i = $scope.albumIDs.length; i < newSize; i++) { $scope.albumIDs.push($scope.allAlbums[i]); }