diff --git a/www/js/DataModel.js b/www/js/DataModel.js index db79cf84d..47e27c272 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1407,6 +1407,7 @@ angular.module('zmApp.controllers') //console.log("Returning pre-loaded list of " + monitors.length + " monitors"); log("Returning pre-loaded list of " + monitors.length + " monitors"); d.resolve(monitors); + //console.log ("Returning"+JSON.stringify(monitors)); $ionicLoading.hide(); return d.promise; } diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index ae56cd10f..9a4645c78 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -96,25 +96,14 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla }); } - function zoom(percentage) { - var range = timeline.getWindow(); - var interval = range.end - range.start; - - timeline.setWindow({ - start: range.start.valueOf() - interval * percentage, - end: range.end.valueOf() + interval * percentage - }); - } + $scope.move = function(percentage) { move(percentage); }; - $scope.zoom = function(percentage) { - zoom(percentage); - - }; + //----------------------------------------- // Move by X days @@ -299,8 +288,11 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla $scope.$on('$ionicView.beforeEnter', function() { + //$ionicHistory.clearCache(); + //$ionicHistory.clearHistory(); timeline = ''; $scope.newEvents = ''; + }); //------------------------------------------------- @@ -314,6 +306,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla //------------------------------------------------- $scope.$on('$ionicView.afterEnter', function() { + + $scope.monitors = message; console.log("***AFTER ENTER"); $scope.follow = { 'time': NVRDataModel.getLogin().followTimeLine }; @@ -337,7 +331,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla //latestDateDrawn = moment().locale('en').format("YYYY-MM-DD HH:mm:ss"); $scope.modalFromTimelineIsOpen = false; - var tempMon = message; + //var tempMon = message; // lets timeline.onget the abbreviated version of TZ to display @@ -357,7 +351,10 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla } else*/ - $scope.monitors = message; + + + console.log ("MONITORS:"+JSON.stringify($scope.monitors)); + if ($rootScope.customTimelineRange) { $scope.currentMode = 'custom'; console.log("***** CUSTOM RANGE"); @@ -812,7 +809,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla localNewEvents = localNewEvents + NVRDataModel.getMonitorName(myevents[j].Event.MonitorId) + '@' + shortenTime(myevents[j].Event.StartTime) + ' (' + myevents[j].Event.Id + '),'; - console.log ("SHIZ"); + graphData.add({ id: myevents[j].Event.Id, @@ -922,7 +919,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla showCurrentTime: true, editable: false, - throttleRedraw: 100, + //throttleRedraw: 100, moveable: true, zoomable: true, selectable: true, @@ -1270,7 +1267,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla cssClass: 'fa fa-minus-circle', empty: false, onclick: function() { - zoom(0.2); + //zoom(0.2); + timeline.zoomOut(0.2); } }, @@ -1317,7 +1315,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla empty: false, onclick: function() { - zoom(-0.2); + //zoom(-0.2); + timeline.zoomIn(0.2); } },