@@ -72,8 +72,10 @@ define(
72
72
//If conductor has a time system selected already, populate the
73
73
//form from it
74
74
this . $scope . timeSystemModel = { } ;
75
- if ( this . conductor . timeSystem ( ) ) {
76
- this . setFormFromTimeSystem ( this . conductor . timeSystem ( ) ) ;
75
+ var timeSystem = this . conductor . timeSystem ( ) ;
76
+ if ( timeSystem ) {
77
+ this . setFormFromTimeSystem ( timeSystem ) ;
78
+ this . supportsZoom = timeSystem . defaults ( ) . zoom !== undefined ;
77
79
}
78
80
79
81
//Represents the various modes, and the currently selected mode
@@ -114,17 +116,17 @@ define(
114
116
} ;
115
117
116
118
TimeConductorController . prototype . onPan = function ( bounds ) {
117
- this . $scope . panning = true ;
119
+ this . panning = true ;
118
120
this . $scope . boundsModel . start = bounds . start ;
119
121
this . $scope . boundsModel . end = bounds . end ;
120
122
} ;
121
123
122
124
TimeConductorController . prototype . onPanStop = function ( ) {
123
- this . $scope . panning = false ;
125
+ this . panning = false ;
124
126
} ;
125
127
126
128
TimeConductorController . prototype . changeBounds = function ( bounds ) {
127
- if ( ! this . $scope . zooming && ! this . $scope . panning ) {
129
+ if ( ! this . zooming && ! this . panning ) {
128
130
this . setFormFromBounds ( bounds ) ;
129
131
}
130
132
} ;
@@ -136,12 +138,14 @@ define(
136
138
* @private
137
139
*/
138
140
TimeConductorController . prototype . setFormFromBounds = function ( bounds ) {
139
- if ( ! this . $scope . zooming && ! this . $scope . panning ) {
141
+ if ( ! this . zooming && ! this . panning ) {
140
142
this . $scope . boundsModel . start = bounds . start ;
141
143
this . $scope . boundsModel . end = bounds . end ;
142
144
143
- this . $scope . currentZoom = this . toSliderValue ( bounds . end - bounds . start ) ;
144
- this . toTimeUnits ( bounds . end - bounds . start ) ;
145
+ if ( this . supportsZoom ) {
146
+ this . currentZoom = this . toSliderValue ( bounds . end - bounds . start ) ;
147
+ this . toTimeUnits ( bounds . end - bounds . start ) ;
148
+ }
145
149
146
150
if ( ! this . pendingUpdate ) {
147
151
this . pendingUpdate = true ;
@@ -182,8 +186,10 @@ define(
182
186
timeSystemModel . selected = timeSystem ;
183
187
timeSystemModel . format = timeSystem . formats ( ) [ 0 ] ;
184
188
timeSystemModel . deltaFormat = timeSystem . deltaFormat ( ) ;
185
- timeSystemModel . minZoom = timeSystem . defaults ( ) . zoom . min ;
186
- timeSystemModel . maxZoom = timeSystem . defaults ( ) . zoom . max ;
189
+ if ( this . supportsZoom ) {
190
+ timeSystemModel . minZoom = timeSystem . defaults ( ) . zoom . min ;
191
+ timeSystemModel . maxZoom = timeSystem . defaults ( ) . zoom . max ;
192
+ }
187
193
} ;
188
194
189
195
@@ -265,6 +271,8 @@ define(
265
271
266
272
this . setFormFromDeltas ( deltas ) ;
267
273
this . setFormFromBounds ( bounds ) ;
274
+
275
+ this . supportsZoom = newTimeSystem . defaults ( ) . zoom !== undefined ;
268
276
}
269
277
this . setFormFromTimeSystem ( newTimeSystem ) ;
270
278
}
@@ -300,15 +308,13 @@ define(
300
308
if ( zoom . deltas ) {
301
309
this . setFormFromDeltas ( zoom . deltas ) ;
302
310
}
303
-
304
- this . $scope . zooming = true ;
305
311
} ;
306
312
307
313
TimeConductorController . prototype . zoomStop = function ( ) {
308
314
this . updateBoundsFromForm ( this . $scope . boundsModel ) ;
309
315
this . updateDeltasFromForm ( this . $scope . boundsModel ) ;
316
+ this . zooming = false ;
310
317
311
- this . $scope . zooming = false ;
312
318
this . conductorViewService . emit ( 'zoom-stop' ) ;
313
319
} ;
314
320
0 commit comments