@@ -30,8 +30,8 @@ function _allowHTML(string) {
30
30
}
31
31
32
32
class NotificationItem extends React . Component {
33
- constructor ( ) {
34
- super ( ) ;
33
+ constructor ( props ) {
34
+ super ( props ) ;
35
35
this . _styles = { } ;
36
36
this . _notificationTimer = null ;
37
37
this . _height = 0 ;
@@ -44,24 +44,11 @@ class NotificationItem extends React.Component {
44
44
removed : false
45
45
} ;
46
46
47
- this . _getCssPropertyByPosition = this . _getCssPropertyByPosition . bind ( this ) ;
48
- this . _defaultAction = this . _defaultAction . bind ( this ) ;
49
- this . _hideNotification = this . _hideNotification . bind ( this ) ;
50
- this . _removeNotification = this . _removeNotification . bind ( this ) ;
51
- this . _dismiss = this . _dismiss . bind ( this ) ;
52
- this . _showNotification = this . _showNotification . bind ( this ) ;
53
- this . _onTransitionEnd = this . _onTransitionEnd . bind ( this ) ;
54
- this . _handleMouseEnter = this . _handleMouseEnter . bind ( this ) ;
55
- this . _handleMouseLeave = this . _handleMouseLeave . bind ( this ) ;
56
- this . _handleNotificationClick = this . _handleNotificationClick . bind ( this ) ;
57
- }
58
-
59
- componentWillMount ( ) {
60
- var getStyles = this . props . getStyles ;
61
- var level = this . props . notification . level ;
62
- var dismissible = this . props . notification . dismissible ;
47
+ const getStyles = props . getStyles ;
48
+ const level = props . notification . level ;
49
+ const dismissible = props . notification . dismissible ;
63
50
64
- this . _noAnimation = this . props . noAnimation ;
51
+ this . _noAnimation = props . noAnimation ;
65
52
66
53
this . _styles = {
67
54
notification : getStyles . byElement ( 'notification' ) ( level ) ,
@@ -75,6 +62,17 @@ class NotificationItem extends React.Component {
75
62
if ( ! dismissible || dismissible === 'none' || dismissible === 'button' ) {
76
63
this . _styles . notification . cursor = 'default' ;
77
64
}
65
+
66
+ this . _getCssPropertyByPosition = this . _getCssPropertyByPosition . bind ( this ) ;
67
+ this . _defaultAction = this . _defaultAction . bind ( this ) ;
68
+ this . _hideNotification = this . _hideNotification . bind ( this ) ;
69
+ this . _removeNotification = this . _removeNotification . bind ( this ) ;
70
+ this . _dismiss = this . _dismiss . bind ( this ) ;
71
+ this . _showNotification = this . _showNotification . bind ( this ) ;
72
+ this . _onTransitionEnd = this . _onTransitionEnd . bind ( this ) ;
73
+ this . _handleMouseEnter = this . _handleMouseEnter . bind ( this ) ;
74
+ this . _handleMouseLeave = this . _handleMouseLeave . bind ( this ) ;
75
+ this . _handleNotificationClick = this . _handleNotificationClick . bind ( this ) ;
78
76
}
79
77
80
78
_getCssPropertyByPosition ( ) {
0 commit comments