diff --git a/example/localTimeSystem/src/LocalTimeSystem.js b/example/localTimeSystem/src/LocalTimeSystem.js index b109360828..2ffd61fc0f 100644 --- a/example/localTimeSystem/src/LocalTimeSystem.js +++ b/example/localTimeSystem/src/LocalTimeSystem.js @@ -67,23 +67,14 @@ define([ return this._tickSources; }; - LocalTimeSystem.prototype.defaults = function () { + LocalTimeSystem.prototype.defaults = function (key) { var now = Math.ceil(Date.now() / 1000) * 1000; - return [ - { - key: 'local-default', - name: 'Local 12 hour time system defaults', - mode: 'fixed', - bounds: {start: now - ONE_HOUR, end: now} - }, - { - key: 'local-default', - name: 'Local 12 hour time system defaults', - mode: 'follow', - deltas: {start: THIRTY_MINUTES, end: 0}, - bounds: {start: now - THIRTY_MINUTES, end: now} - } - ]; + return { + key: 'local-default', + name: 'Local 12 hour time system defaults', + deltas: {start: THIRTY_MINUTES, end: 0}, + bounds: {start: now - THIRTY_MINUTES, end: now} + }; }; return LocalTimeSystem; diff --git a/platform/features/conductor-v2/conductor/src/ui/TimeConductorController.js b/platform/features/conductor-v2/conductor/src/ui/TimeConductorController.js index 7f19187d61..c6a3c030d9 100644 --- a/platform/features/conductor-v2/conductor/src/ui/TimeConductorController.js +++ b/platform/features/conductor-v2/conductor/src/ui/TimeConductorController.js @@ -206,7 +206,7 @@ define( return source.type() === sourceType; })[0]; } - + /** * Change the selected Time Conductor mode. This will call destroy * and initialization functions on the relevant modes, setting diff --git a/platform/features/conductor-v2/conductor/src/ui/modes/FixedMode.js b/platform/features/conductor-v2/conductor/src/ui/modes/FixedMode.js index 2da9dd231a..b4702a35a4 100644 --- a/platform/features/conductor-v2/conductor/src/ui/modes/FixedMode.js +++ b/platform/features/conductor-v2/conductor/src/ui/modes/FixedMode.js @@ -43,16 +43,6 @@ define( this.conductor.follow(false); }; - FixedMode.prototype.defaults = function () { - var timeSystem = this.timeSystem(); - - if (timeSystem){ - return timeSystem.defaults().filter(function (d) { - return d.mode === 'fixed'; - })[0]; - } - }; - /** * Defines behavior to occur when selected time system changes. In * this case, sets default bounds on the time conductor. diff --git a/platform/features/conductor-v2/conductor/src/ui/modes/FollowMode.js b/platform/features/conductor-v2/conductor/src/ui/modes/FollowMode.js index d249de61f9..a6171d42e6 100644 --- a/platform/features/conductor-v2/conductor/src/ui/modes/FollowMode.js +++ b/platform/features/conductor-v2/conductor/src/ui/modes/FollowMode.js @@ -77,16 +77,6 @@ define( return this._tickSource; }; - FollowMode.prototype.defaults = function () { - var timeSystem = this.timeSystem(); - - if (timeSystem){ - return timeSystem.defaults().filter(function (d) { - return d.mode === 'follow'; - })[0]; - } - }; - /** * On time system change, default the bounds values in the time * conductor, using the deltas associated with this mode. diff --git a/platform/features/conductor-v2/conductor/src/ui/modes/TimeConductorMode.js b/platform/features/conductor-v2/conductor/src/ui/modes/TimeConductorMode.js index 5b3211db6c..29530f3fae 100644 --- a/platform/features/conductor-v2/conductor/src/ui/modes/TimeConductorMode.js +++ b/platform/features/conductor-v2/conductor/src/ui/modes/TimeConductorMode.js @@ -63,7 +63,12 @@ define( }; TimeConductorMode.prototype.defaults = function () { - throw new Error("Not implemented"); + var timeSystem = this.timeSystem(), + key = this.key(); + + if (timeSystem) { + return timeSystem.defaults(key); + } }; TimeConductorMode.prototype.destroy = function () { diff --git a/platform/features/conductor-v2/utcTimeSystem/src/UTCTimeSystem.js b/platform/features/conductor-v2/utcTimeSystem/src/UTCTimeSystem.js index 29aeb83f2a..4412c55822 100644 --- a/platform/features/conductor-v2/utcTimeSystem/src/UTCTimeSystem.js +++ b/platform/features/conductor-v2/utcTimeSystem/src/UTCTimeSystem.js @@ -64,23 +64,14 @@ define([ return this._tickSources; }; - UTCTimeSystem.prototype.defaults = function () { + UTCTimeSystem.prototype.defaults = function (key) { var now = Math.ceil(Date.now() / 1000) * 1000; - return [ - { - 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', - bounds: {start: now - FIFTEEN_MINUTES, end: now} - } - ]; + return { + key: 'utc-default', + name: 'UTC time system defaults', + deltas: {start: FIFTEEN_MINUTES, end: 0}, + bounds: {start: now - FIFTEEN_MINUTES, end: now} + }; }; return UTCTimeSystem;