diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-11-06 10:28:22 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-11-06 10:28:22 -0500 |
| commit | 5b80d3916cd91d630a0142f76a87b4863b714203 (patch) | |
| tree | 4ac995a0eb3bc935f46800a5c3f0c2707ece9895 /www | |
| parent | 36b084bd099ba6369a721a38ecd33db0eb666c20 (diff) | |
Fixes bug of indefinite loading after resetting custom timeline #360
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventDateTimeFilterCtrl.js | 27 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 47 |
2 files changed, 46 insertions, 28 deletions
diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index 4b28140d..24df1f52 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -48,14 +48,25 @@ angular.module('zmApp.controllers') // you are looking at a specific monitor ID // going back will only retain that monitor ID // so lets reload with all monitors - $ionicHistory.nextViewOptions({ - disableBack: true - }); - $state.go("events", { - "id": 0, - "playEvent":false - }); - return; + // + //console.log (">>> BACKVIEW="+$ionicHistory.backTitle()); + + if ($ionicHistory.backTitle() == 'Timeline') + { + $ionicHistory.goBack(); + } + else // in events, backview is undefined? + { + $ionicHistory.nextViewOptions({ + disableBack: true + }); + $state.go("events", { + "id": 0, + "playEvent":false + }); + return; + } + //$ionicHistory.goBack(); }; diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 94c71b60..ae56cd10 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -290,25 +290,12 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla }); - $scope.$on('$ionicView.enter', function() { + /*$scope.$on('$ionicView.enter', function() { - // Make sure sliding for menu is disabled so it - // does not interfere with graph panning - $ionicSideMenuDelegate.canDragContent(false); - var ld = NVRDataModel.getLogin(); - maxItemsConf = ($rootScope.platformOS == 'desktop') ? zm.graphDesktopItemMax : zm.graphItemMax; - maxItems = ld.graphSize || maxItemsConf; - NVRDataModel.log("Graph items to draw is " + maxItems); - $scope.maxItems = maxItems; - $scope.translationData = { - maxItemsVal: maxItems - }; - - $scope.graphLoaded = false; - NVRDataModel.debug("TimelineCtrl/drawGraph: graphLoaded is " + $scope.graphLoaded); - }); + + });*/ $scope.$on('$ionicView.beforeEnter', function() { @@ -327,12 +314,27 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla //------------------------------------------------- $scope.$on('$ionicView.afterEnter', function() { - // console.log("***AFTER ENTER"); + console.log("***AFTER ENTER"); $scope.follow = { 'time': NVRDataModel.getLogin().followTimeLine }; $interval.cancel(updateInterval); + // Make sure sliding for menu is disabled so it + // does not interfere with graph panning + $ionicSideMenuDelegate.canDragContent(false); + var ld = NVRDataModel.getLogin(); + maxItemsConf = ($rootScope.platformOS == 'desktop') ? zm.graphDesktopItemMax : zm.graphItemMax; + maxItems = ld.graphSize || maxItemsConf; + NVRDataModel.log("Graph items to draw is " + maxItems); + $scope.maxItems = maxItems; + $scope.translationData = { + maxItemsVal: maxItems + }; + + $scope.graphLoaded = false; + NVRDataModel.debug("TimelineCtrl/drawGraph: graphLoaded is " + $scope.graphLoaded); + //latestDateDrawn = moment().locale('en').format("YYYY-MM-DD HH:mm:ss"); $scope.modalFromTimelineIsOpen = false; var tempMon = message; @@ -346,7 +348,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla } //console.log ("TIMELINE MONITORS: " + JSON.stringify(message)); - var ld = NVRDataModel.getLogin(); + //var ld = NVRDataModel.getLogin(); $scope.loginData = NVRDataModel.getLogin(); /* if (ld.persistMontageOrder) { @@ -358,7 +360,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla $scope.monitors = message; if ($rootScope.customTimelineRange) { $scope.currentMode = 'custom'; - // console.log("***** CUSTOM RANGE"); + console.log("***** CUSTOM RANGE"); if (moment($rootScope.fromString).isValid() && moment($rootScope.toString).isValid()) { // console.log("FROM & TO IS CUSTOM"); @@ -368,7 +370,11 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla $scope.toDate = toDate; drawGraph(fromDate, toDate, maxItems); } else { - // console.log("FROM & TO IS CUSTOM INVALID"); + console.log ("From:"+$rootScope.fromString + " To:"+$rootScope.toString); + console.log("FROM & TO IS CUSTOM INVALID"); + fromDate = moment().startOf('day').format("YYYY-MM-DD HH:mm:ss"); + toDate = moment().endOf('day').format("YYYY-MM-DD HH:mm:ss"); + drawGraph(fromDate, toDate, maxItems); } } else { $scope.currentMode = 'day'; @@ -869,6 +875,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla function drawGraph(fromDate, toDate, count) { + console.log ("INSIDE DRAW"); $scope.newEvents = ""; // we only need this for day mode |
