Skip to content

Commit

Permalink
Moved to 4.17 built in zoom function of vis
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Nov 7, 2016
1 parent 77faead commit cf71e2d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions www/js/DataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
37 changes: 18 additions & 19 deletions www/js/TimelineCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -299,8 +288,11 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla

$scope.$on('$ionicView.beforeEnter', function() {

//$ionicHistory.clearCache();
//$ionicHistory.clearHistory();
timeline = '';
$scope.newEvents = '';

});

//-------------------------------------------------
Expand All @@ -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 };
Expand All @@ -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
Expand All @@ -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");
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
},

Expand Down Expand Up @@ -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);
}
},

Expand Down

0 comments on commit cf71e2d

Please sign in to comment.