diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-04-01 10:41:33 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-04-01 10:41:33 -0400 |
| commit | d3f511253b50bfcb1c578ddc9280cecf1e037cf4 (patch) | |
| tree | af4562ba9b3e27fbe854c6534db0876bb34e649b /www/js | |
| parent | eb4632b0aa7a945564cefc1a7478a2bbc4881be0 (diff) | |
#209 - final fixes?
Former-commit-id: 0b7a117a396b6cf915936b0b484a1b453af0250f
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/TimelineCtrl.js | 1 | ||||
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 9c0f966e..c30c141a 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -203,6 +203,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla // $interval.cancel(eventsInterval); //$interval.cancel(segmentHandle); ZMDataModel.zmDebug("TimelineCtrl:Close & Destroy Modal"); + ZMDataModel.stopNetwork("TimelineCtrl: closeModal"); ZMDataModel.setAwake(false); if ($scope.modal !== undefined) { $scope.modal.remove(); diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index 9895bc4c..535e8f14 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -94,6 +94,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' $scope.$on('modal.shown', function () { + $scope.graphWidth=$rootScope.devWidth-30; + ZMDataModel.zmLog ("Setting init graph width to " + $scope.graphWidth); $scope.dataReady = false; ZMDataModel.getKeyConfigParams(0) @@ -192,6 +194,12 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' legendTemplate : '<ul class="tc-chart-js-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>' }; + $scope.graphWidth = event.event.Frame.length * 10; + if ($scope.graphWidth < $rootScope.devWidth) + $scope.graphWidth = $rootScope.devWidth; + + ZMDataModel.zmLog ("Changing graph width to " + $scope.graphWidth); + for (var i=0; i< event.event.Frame.length; i++) { data.labels.push(event.event.Frame[i].TimeStamp); @@ -214,7 +222,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' cv = document.getElementById("tcchart"); ctx = cv.getContext("2d"); - tcGraph = new Chart(ctx,{type:'bar', data: data, options:options}); + $timeout(function() { + tcGraph = new Chart(ctx,{type:'bar', data: data, options:options});}); cv.onclick = function(e) { |
