From ced7ea1ef0d12c050abd8d88ce39fa2fc4a1d84d Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Tue, 17 Nov 2015 13:10:52 -0500 Subject: #88 - have a graphDesktopItemMax now to keep a max size even in desktops Former-commit-id: 278c8e76b0f0119a917cb4994bb84f96133ddeaa --- www/js/TimelineCtrl.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'www/js') diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 1a7faae6..09c7bc90 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -7,7 +7,7 @@ // This controller creates a timeline // It uses the visjs library, but due to performance reasons // I've disabled pan and zoom and used buttons instead -// also limits # of items to maxItems (currently 200) +// also limits # of items to maxItems // FIXME: too much redundant code between EventCtrl and Timeline @@ -277,7 +277,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla console.log ("*********************** TIMELINE MAIN "); // maxItems will be ignored during timeline draw if its desktop - var maxItems = zm.graphItemMax; // THAT magic # --> 300 and ZM on my m/c cries + var maxItems = ($rootScope.platformOS == 'desktop') ? zm.graphDesktopItemMax: zm.graphItemMax; + $scope.maxItems = maxItems; $scope.graphLoaded = false; ZMDataModel.zmDebug("TimelineCtrl/drawGraph: graphLoaded is " + $scope.graphLoaded); @@ -497,8 +498,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla for (var j = 0; j < data.length; j++) { var myevents = data[j]; - if (graphIndex > zm.graphItemMax && $rootScope.platformOS != "desktop") { - ZMDataModel.zmLog("Exiting page count graph - reached limit of " + zm.graphItemMax); + if (graphIndex > count) { + ZMDataModel.zmLog("Exiting page count graph - reached limit of " + count); break; } @@ -556,8 +557,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla - if (graphIndex > zm.graphItemMax && $rootScope.platformOS != "desktop") { - ZMDataModel.zmLog("Exiting event graph - reached limit of " + zm.graphItemMax); + if (graphIndex > count) { + ZMDataModel.zmLog("Exiting event graph - reached limit of " + count); break; } -- cgit v1.2.3