summaryrefslogtreecommitdiff
path: root/www/js/TimelineCtrl.js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-11-20 17:28:35 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-11-20 17:28:35 -0500
commit3199652694d304b17dcc787d473f5efaa64b9cb3 (patch)
tree4cfc77e0094c67ca080cdfaefc5af1285efc9e2a /www/js/TimelineCtrl.js
parentbf239e006e52349861a62dab2e2cdf2c5c484f58 (diff)
#104 - handle less than items per page count
Former-commit-id: add9fb5776836feb551e013c676a3eed4ff7a66f
Diffstat (limited to 'www/js/TimelineCtrl.js')
-rw-r--r--www/js/TimelineCtrl.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js
index 7f100ff5..048fc03e 100644
--- a/www/js/TimelineCtrl.js
+++ b/www/js/TimelineCtrl.js
@@ -466,7 +466,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla
// I figure out how many items the server returns per API page
// and divide the # of items I want (currently 200) with # of items per page
// So iterCount is the # of HTTP calls I need to make
- iterCount = Math.round(count / itemsPerPage);
+ iterCount = Math.max(Math.round(count / itemsPerPage),1);
ZMDataModel.zmDebug("TimelineCtrl/drawGraph: pages of data: " + pages + " items per page: " + itemsPerPage);
ZMDataModel.zmDebug("TimelineCtrl/drawGraph: I will make " + iterCount + " HTTP Requests to get all graph data");