Skip to content

Commit

Permalink
[TCv2] different defaults by mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Richards committed Aug 4, 2016
1 parent f4e1879 commit 9a72c96
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions example/localTimeSystem/src/LocalTimeSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ define([
{
key: 'local-default',
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},
bounds: {start: now - FIFTEEN_MINUTES, end: now}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ define(
TimeConductorMode.prototype.selectedTimeSystem.apply(this, arguments);

if (timeSystem) {
var defaults = timeSystem.defaults()[0];
var defaults = timeSystem.defaults().filter(function (d) {
return d.mode === 'fixed';
})[0];

var bounds = {
start: defaults.bounds.start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ define(
this.tickSourceUnlisten();
}

var defaults = timeSystem.defaults()[0];
var defaults = timeSystem.defaults().filter(function (d) {
return d.mode === 'follow';
})[0];

if (arguments.length > 0) {
var bounds = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ define([
{
key: 'utc-default',
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},
bounds: {start: now - FIFTEEN_MINUTES, end: now}
}
Expand Down

0 comments on commit 9a72c96

Please sign in to comment.