Skip to content

Commit

Permalink
TimePicker openDialog() similar to DatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfoo committed Oct 22, 2015
1 parent bba2703 commit 2a4ce1f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/time-picker/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ const TimePicker = React.createClass({
this.refs.input.setValue(this.formatTime(t));
},

openDialog() {
this.setState({
dialogTime: this.getTime(),
});

this.refs.dialogWindow.show();
},

_handleDialogAccept(t) {
this.setTime(t);
if (this.props.onChange) this.props.onChange(null, t);
Expand All @@ -133,11 +141,8 @@ const TimePicker = React.createClass({
_handleInputTouchTap(e) {
e.preventDefault();

this.setState({
dialogTime: this.getTime(),
});
this.openDialog();

this.refs.dialogWindow.show();
if (this.props.onTouchTap) this.props.onTouchTap(e);
},
});
Expand Down

0 comments on commit 2a4ce1f

Please sign in to comment.