[Time Conductor] Remove now dependency, fix domain switch

Remove dependency on now (current time can be retrieved via
timeService); fix domain-switching behavior such that changes
to time systems are reflected in changes to default bounds.
This commit is contained in:
Victor Woeltjen 2015-10-22 16:05:09 -07:00
parent a154c9c870
commit 16e4c32709
2 changed files with 4 additions and 6 deletions

View File

@ -66,7 +66,7 @@
{
"key": "TimeRangeController",
"implementation": "controllers/TimeRangeController.js",
"depends": [ "$scope", "timeService", "now" ]
"depends": [ "$scope", "timeService" ]
},
{
"key": "DateTimePickerController",

View File

@ -34,7 +34,7 @@ define(
* @memberof platform/commonUI/general
* @constructor
*/
function TimeRangeController($scope, timeService, now) {
function TimeRangeController($scope, timeService) {
var tickCount = 2,
innerMinimumSpan = 1000, // 1 second
outerMinimumSpan = 1000 * 60 * 60, // 1 hour
@ -91,7 +91,7 @@ define(
}
function defaultBounds() {
var t = now();
var t = timeSystem.now();
return {
start: t - 24 * 3600 * 1000, // One day
end: t
@ -122,8 +122,6 @@ define(
}
function updateViewFromModel(ngModel) {
var t = now();
ngModel = ngModel || {};
ngModel.outer = ngModel.outer || defaultBounds();
ngModel.inner = ngModel.inner || copyBounds(ngModel.outer);
@ -274,7 +272,7 @@ define(
$scope.ngModel.inner.start = start;
$scope.ngModel.inner.end = end;
$scope.boundsModel = {};
updateViewFromModel();
updateViewFromModel($scope.ngModel);
}
function updateTimeSystem(key) {