@@ -49,7 +49,6 @@ const DatePickerDialog = React.createClass({
4949 maxDate : React . PropTypes . object ,
5050 minDate : React . PropTypes . object ,
5151 onAccept : React . PropTypes . func ,
52- onClickAway : React . PropTypes . func ,
5352 onDismiss : React . PropTypes . func ,
5453 onShow : React . PropTypes . func ,
5554 style : React . PropTypes . object ,
@@ -87,7 +86,6 @@ const DatePickerDialog = React.createClass({
8786 getInitialState ( ) {
8887 return {
8988 open : false ,
90- isCalendarActive : false ,
9189 muiTheme : this . context . muiTheme ? this . context . muiTheme : ThemeManager . getMuiTheme ( DefaultRawTheme ) ,
9290 } ;
9391 } ,
@@ -108,6 +106,8 @@ const DatePickerDialog = React.createClass({
108106 onAccept,
109107 style,
110108 container,
109+ onDismiss,
110+ onShow,
111111 ...other ,
112112 } = this . props ;
113113
@@ -164,9 +164,8 @@ const DatePickerDialog = React.createClass({
164164 contentStyle = { styles . dialogContent }
165165 bodyStyle = { styles . dialogBodyContent }
166166 actions = { actions }
167- onDismiss = { this . _handleDialogDismiss }
168- onShow = { this . _handleDialogShow }
169- onClickAway = { this . _handleDialogClickAway }
167+ onDismiss = { typeof onDismiss === 'function' && onDismiss }
168+ onShow = { typeof onShow === 'function' && onShow }
170169 repositionOnUpdate = { false }
171170 open = { this . state . open }
172171 onRequestClose = { this . dismiss } >
@@ -176,7 +175,7 @@ const DatePickerDialog = React.createClass({
176175 ref = "calendar"
177176 onDayTouchTap = { this . _onDayTouchTap }
178177 initialDate = { this . props . initialDate }
179- isActive = { this . state . isCalendarActive }
178+ open = { this . state . open }
180179 minDate = { this . props . minDate }
181180 maxDate = { this . props . maxDate }
182181 shouldDisableDate = { this . props . shouldDisableDate }
@@ -216,36 +215,8 @@ const DatePickerDialog = React.createClass({
216215 this . dismiss ( ) ;
217216 } ,
218217
219- _handleDialogShow ( ) {
220- this . setState ( {
221- isCalendarActive : true ,
222- } ) ;
223-
224- if ( this . props . onShow ) this . props . onShow ( ) ;
225- } ,
226-
227- _handleDialogDismiss ( ) {
228- CssEvent . onTransitionEnd ( ReactDOM . findDOMNode ( this . refs . dialog ) , ( ) => {
229- this . setState ( {
230- isCalendarActive : false ,
231- } ) ;
232- } ) ;
233-
234- if ( this . props . onDismiss ) this . props . onDismiss ( ) ;
235- } ,
236-
237- _handleDialogClickAway ( ) {
238- CssEvent . onTransitionEnd ( ReactDOM . findDOMNode ( this . refs . dialog ) , ( ) => {
239- this . setState ( {
240- isCalendarActive : false ,
241- } ) ;
242- } ) ;
243-
244- if ( this . props . onClickAway ) this . props . onClickAway ( ) ;
245- } ,
246-
247218 _handleWindowKeyUp ( e ) {
248- if ( this . state . isCalendarActive ) {
219+ if ( this . state . open ) {
249220 switch ( e . keyCode ) {
250221 case KeyCode . ENTER :
251222 this . _handleOKTouchTap ( ) ;
0 commit comments