[TCv2] different defaults by mode

This commit is contained in:
Pete Richards 2016-08-03 18:06:39 -07:00
parent f4e1879a2d
commit 9a72c96ea4
4 changed files with 22 additions and 2 deletions
example/localTimeSystem/src
platform/features/conductor-v2
conductor/src/ui/modes
utcTimeSystem/src

@ -70,6 +70,14 @@ define([
{ {
key: 'local-default', key: 'local-default',
name: 'Local 12 hour time system defaults', name: 'Local 12 hour time system defaults',
mode: 'fixed',
deltas: {start: FIFTEEN_MINUTES, end: 0},
bounds: {start: now - FIFTEEN_MINUTES, end: now}
},
{
key: 'local-default',
name: 'Local 12 hour time system defaults',
mode: 'follow',
deltas: {start: FIFTEEN_MINUTES, end: 0}, deltas: {start: FIFTEEN_MINUTES, end: 0},
bounds: {start: now - FIFTEEN_MINUTES, end: now} bounds: {start: now - FIFTEEN_MINUTES, end: now}
} }

@ -53,7 +53,9 @@ define(
TimeConductorMode.prototype.selectedTimeSystem.apply(this, arguments); TimeConductorMode.prototype.selectedTimeSystem.apply(this, arguments);
if (timeSystem) { if (timeSystem) {
var defaults = timeSystem.defaults()[0]; var defaults = timeSystem.defaults().filter(function (d) {
return d.mode === 'fixed';
})[0];
var bounds = { var bounds = {
start: defaults.bounds.start, start: defaults.bounds.start,

@ -87,7 +87,9 @@ define(
this.tickSourceUnlisten(); this.tickSourceUnlisten();
} }
var defaults = timeSystem.defaults()[0]; var defaults = timeSystem.defaults().filter(function (d) {
return d.mode === 'follow';
})[0];
if (arguments.length > 0) { if (arguments.length > 0) {
var bounds = { var bounds = {

@ -70,6 +70,14 @@ define([
{ {
key: 'utc-default', key: 'utc-default',
name: 'UTC time system defaults', name: 'UTC time system defaults',
mode: 'follow',
deltas: {start: FIFTEEN_MINUTES, end: 0},
bounds: {start: now - FIFTEEN_MINUTES, end: now}
},
{
key: 'utc-default',
name: 'UTC time system defaults',
mode: 'fixed',
deltas: {start: FIFTEEN_MINUTES, end: 0}, deltas: {start: FIFTEEN_MINUTES, end: 0},
bounds: {start: now - FIFTEEN_MINUTES, end: now} bounds: {start: now - FIFTEEN_MINUTES, end: now}
} }