@@ -7,38 +7,21 @@ const SimpleSwitch = require('a-simple-switch');
7
7
*
8
8
* @return {void }
9
9
*/
10
- const setActiveRegion = ( checked , shouldToggleAnimations ) => {
10
+ const setActiveRegion = ( checked ) => {
11
11
const activeWoClass = 'c-pega-wwo__active-wo' ;
12
12
const activeWClass = 'c-pega-wwo__active-w' ;
13
13
const mainWrapper = document . querySelector ( '.c-pega-wwo__wrapper' ) ;
14
14
mainWrapper . classList . add ( checked ? activeWClass : activeWoClass ) ;
15
15
mainWrapper . classList . remove ( checked ? activeWoClass : activeWClass ) ;
16
16
} ;
17
17
18
- // const toggleAnimations = (classToActivate, classToDeactivate) => {
19
- // const animationClasses = ['c-pega-wwo__sm-circle'];
20
- // const animationAttribute = 'data-anim-triggered';
21
- // animationClasses.forEach((animationClass) => {
22
- // const activateEl = document.querySelector(`.${classToActivate} .${animationClass}`);
23
- // if (activateEl) {
24
- // activateEl.setAttribute(animationAttribute, 'yes');
25
- // }
26
- // const deActivateEl = document.querySelector(`.${classToDeactivate} .${animationClass}`);
27
- // if (deActivateEl) {
28
- // deActivateEl.setAttribute(animationAttribute, 'yes');
29
- // }
30
- // });
31
- // };
32
-
33
- window . onload = ( ) => {
34
- setTimeout ( ( ) => {
35
- const toggleInputClass = '#c-pega-wwo__toggle-input' ;
36
- SimpleSwitch . init ( ) ;
37
- setActiveRegion ( document . querySelector ( toggleInputClass ) . checked ) ;
38
- document
39
- . querySelector ( '#c-pega-wwo__toggle-input' )
40
- . addEventListener ( 'change' , e => {
41
- setActiveRegion ( e . target . checked ) ;
42
- } ) ;
43
- } , 4000 ) ;
44
- } ;
18
+ setTimeout ( ( ) => {
19
+ const toggleInputClass = '#c-pega-wwo__toggle-input' ;
20
+ SimpleSwitch . init ( ) ;
21
+ setActiveRegion ( document . querySelector ( toggleInputClass ) . checked ) ;
22
+ document
23
+ . querySelector ( '#c-pega-wwo__toggle-input' )
24
+ . addEventListener ( 'change' , e => {
25
+ setActiveRegion ( e . target . checked ) ;
26
+ } ) ;
27
+ } , 0 ) ;
0 commit comments