File tree 6 files changed +21
-54
lines changed
example/localTimeSystem/src
platform/features/conductor-v2
6 files changed +21
-54
lines changed Original file line number Diff line number Diff line change @@ -67,23 +67,14 @@ define([
67
67
return this . _tickSources ;
68
68
} ;
69
69
70
- LocalTimeSystem . prototype . defaults = function ( ) {
70
+ LocalTimeSystem . prototype . defaults = function ( key ) {
71
71
var now = Math . ceil ( Date . now ( ) / 1000 ) * 1000 ;
72
- return [
73
- {
74
- key : 'local-default' ,
75
- name : 'Local 12 hour time system defaults' ,
76
- mode : 'fixed' ,
77
- bounds : { start : now - ONE_HOUR , end : now }
78
- } ,
79
- {
80
- key : 'local-default' ,
81
- name : 'Local 12 hour time system defaults' ,
82
- mode : 'follow' ,
83
- deltas : { start : THIRTY_MINUTES , end : 0 } ,
84
- bounds : { start : now - THIRTY_MINUTES , end : now }
85
- }
86
- ] ;
72
+ return {
73
+ key : 'local-default' ,
74
+ name : 'Local 12 hour time system defaults' ,
75
+ deltas : { start : THIRTY_MINUTES , end : 0 } ,
76
+ bounds : { start : now - THIRTY_MINUTES , end : now }
77
+ } ;
87
78
} ;
88
79
89
80
return LocalTimeSystem ;
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ define(
206
206
return source . type ( ) === sourceType ;
207
207
} ) [ 0 ] ;
208
208
}
209
-
209
+
210
210
/**
211
211
* Change the selected Time Conductor mode. This will call destroy
212
212
* and initialization functions on the relevant modes, setting
Original file line number Diff line number Diff line change @@ -43,16 +43,6 @@ define(
43
43
this . conductor . follow ( false ) ;
44
44
} ;
45
45
46
- FixedMode . prototype . defaults = function ( ) {
47
- var timeSystem = this . timeSystem ( ) ;
48
-
49
- if ( timeSystem ) {
50
- return timeSystem . defaults ( ) . filter ( function ( d ) {
51
- return d . mode === 'fixed' ;
52
- } ) [ 0 ] ;
53
- }
54
- } ;
55
-
56
46
/**
57
47
* Defines behavior to occur when selected time system changes. In
58
48
* this case, sets default bounds on the time conductor.
Original file line number Diff line number Diff line change @@ -77,16 +77,6 @@ define(
77
77
return this . _tickSource ;
78
78
} ;
79
79
80
- FollowMode . prototype . defaults = function ( ) {
81
- var timeSystem = this . timeSystem ( ) ;
82
-
83
- if ( timeSystem ) {
84
- return timeSystem . defaults ( ) . filter ( function ( d ) {
85
- return d . mode === 'follow' ;
86
- } ) [ 0 ] ;
87
- }
88
- } ;
89
-
90
80
/**
91
81
* On time system change, default the bounds values in the time
92
82
* conductor, using the deltas associated with this mode.
Original file line number Diff line number Diff line change @@ -63,7 +63,12 @@ define(
63
63
} ;
64
64
65
65
TimeConductorMode . prototype . defaults = function ( ) {
66
- throw new Error ( "Not implemented" ) ;
66
+ var timeSystem = this . timeSystem ( ) ,
67
+ key = this . key ( ) ;
68
+
69
+ if ( timeSystem ) {
70
+ return timeSystem . defaults ( key ) ;
71
+ }
67
72
} ;
68
73
69
74
TimeConductorMode . prototype . destroy = function ( ) {
Original file line number Diff line number Diff line change @@ -64,23 +64,14 @@ define([
64
64
return this . _tickSources ;
65
65
} ;
66
66
67
- UTCTimeSystem . prototype . defaults = function ( ) {
67
+ UTCTimeSystem . prototype . defaults = function ( key ) {
68
68
var now = Math . ceil ( Date . now ( ) / 1000 ) * 1000 ;
69
- return [
70
- {
71
- key : 'utc-default' ,
72
- name : 'UTC time system defaults' ,
73
- mode : 'follow' ,
74
- deltas : { start : FIFTEEN_MINUTES , end : 0 } ,
75
- bounds : { start : now - FIFTEEN_MINUTES , end : now }
76
- } ,
77
- {
78
- key : 'utc-default' ,
79
- name : 'UTC time system defaults' ,
80
- mode : 'fixed' ,
81
- bounds : { start : now - FIFTEEN_MINUTES , end : now }
82
- }
83
- ] ;
69
+ return {
70
+ key : 'utc-default' ,
71
+ name : 'UTC time system defaults' ,
72
+ deltas : { start : FIFTEEN_MINUTES , end : 0 } ,
73
+ bounds : { start : now - FIFTEEN_MINUTES , end : now }
74
+ } ;
84
75
} ;
85
76
86
77
return UTCTimeSystem ;
You can’t perform that action at this time.
0 commit comments