@@ -226,18 +226,6 @@ export default Component.extend(EventWizardMixin, FormMixin, {
226
226
if ( this . data . event . customForms && ! this . data . event . customForms . length ) {
227
227
this . set ( 'data.event.customForms' , this . getCustomForm ( this . data . event ) ) ;
228
228
}
229
-
230
- if ( this . data . event . sessionTypes && ! this . data . event . sessionTypes . length ) {
231
- this . data . event . sessionTypes . addObject ( this . store . createRecord ( 'session-type' ) ) ;
232
- }
233
-
234
- if ( this . data . event . tracks && ! this . data . event . tracks . length ) {
235
- this . data . event . tracks . addObject ( this . store . createRecord ( 'track' ) ) ;
236
- }
237
-
238
- if ( this . data . event . microlocations && ! this . data . event . microlocations . length ) {
239
- this . data . event . microlocations . addObject ( this . store . createRecord ( 'microlocation' ) ) ;
240
- }
241
229
} ,
242
230
243
231
actions : {
@@ -301,6 +289,35 @@ export default Component.extend(EventWizardMixin, FormMixin, {
301
289
} ,
302
290
onChange ( ) {
303
291
this . onValid ( ( ) => { } ) ;
292
+ } ,
293
+ toggleSessionSpeaker ( ) {
294
+ if ( ! this . data . event . isSessionsSpeakersEnabled ) {
295
+ this . set ( 'data.event.isSessionsSpeakersEnabled' , true ) ;
296
+ if ( this . data . event . sessionTypes && ! this . data . event . sessionTypes . length ) {
297
+ this . data . event . sessionTypes . addObject ( this . store . createRecord ( 'session-type' ) ) ;
298
+ }
299
+
300
+ if ( this . data . event . tracks && ! this . data . event . tracks . length ) {
301
+ this . data . event . tracks . addObject ( this . store . createRecord ( 'track' ) ) ;
302
+ }
303
+
304
+ if ( this . data . event . microlocations && ! this . data . event . microlocations . length ) {
305
+ this . data . event . microlocations . addObject ( this . store . createRecord ( 'microlocation' ) ) ;
306
+ }
307
+ } else {
308
+ this . set ( 'data.event.isSessionsSpeakersEnabled' , false ) ;
309
+ if ( this . data . event . sessionTypes && this . data . event . sessionTypes . length ) {
310
+ this . data . event . sessionTypes . clear ( ) ;
311
+ }
312
+
313
+ if ( this . data . event . tracks && this . data . event . tracks . length ) {
314
+ this . data . event . tracks . clear ( ) ;
315
+ }
316
+
317
+ if ( this . data . event . microlocations && this . data . event . microlocations . length ) {
318
+ this . data . event . microlocations . clear ( ) ;
319
+ }
320
+ }
304
321
}
305
322
}
306
323
} ) ;
0 commit comments