21
21
* THE SOFTWARE.
22
22
*/
23
23
24
- import { getCorrectEventName } from '@material/animation/index.ts' ;
24
+ import { StandardJsEventType , getCorrectEventName } from '@material/animation/index.ts' ;
25
25
import MDCComponent from '@material/base/component' ;
26
26
/* eslint-disable no-unused-vars */
27
27
import { MDCSelectionControlState , MDCSelectionControl } from '@material/selection-control/index' ;
@@ -33,6 +33,8 @@ import {getMatchesProperty} from '@material/ripple/util';
33
33
/** @const {!Array<string>} */
34
34
const CB_PROTO_PROPS = [ 'checked' , 'indeterminate' ] ;
35
35
36
+ const { ANIMATION_END } = StandardJsEventType ;
37
+
36
38
/**
37
39
* @extends MDCComponent<!MDCCheckboxFoundation>
38
40
* @implements {MDCSelectionControl}
@@ -69,7 +71,7 @@ class MDCCheckbox extends MDCComponent {
69
71
this . handleChange_ = ( ) => this . foundation_ . handleChange ( ) ;
70
72
this . handleAnimationEnd_ = ( ) => this . foundation_ . handleAnimationEnd ( ) ;
71
73
this . nativeCb_ . addEventListener ( 'change' , this . handleChange_ ) ;
72
- this . listen ( getCorrectEventName ( window , 'animationend' ) , this . handleAnimationEnd_ ) ;
74
+ this . listen ( getCorrectEventName ( window , ANIMATION_END ) , this . handleAnimationEnd_ ) ;
73
75
this . installPropertyChangeHooks_ ( ) ;
74
76
}
75
77
@@ -191,7 +193,7 @@ class MDCCheckbox extends MDCComponent {
191
193
destroy ( ) {
192
194
this . ripple_ . destroy ( ) ;
193
195
this . nativeCb_ . removeEventListener ( 'change' , this . handleChange_ ) ;
194
- this . unlisten ( getCorrectEventName ( window , 'animationend' ) , this . handleAnimationEnd_ ) ;
196
+ this . unlisten ( getCorrectEventName ( window , ANIMATION_END ) , this . handleAnimationEnd_ ) ;
195
197
this . uninstallPropertyChangeHooks_ ( ) ;
196
198
super . destroy ( ) ;
197
199
}
0 commit comments