Skip to content

Commit

Permalink
added openDialog() and focus() to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfoo committed Oct 22, 2015
1 parent 2a4ce1f commit 0d768e5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/src/app/components/pages/components/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ let TimePickerPage = React.createClass({
header: 'TimePicker.formatTime(time)',
desc: 'Formats the Date object to a current component\'s time format.',
},
{
name: 'openDialog',
header: 'TimePicker.openDialog()',
desc: 'Opens the time-picker dialog programmatically. Use this if you want to open the ' +
'dialog in response to some event other than focus/tap on the input field, such as an ' +
'external button click.',
},
{
name: 'focus',
header: 'TimePicker.focus()',
desc: 'An alias for the `openDialog()` method to allow more generic use alongside `TextField`.',
},
],
},
{
Expand All @@ -88,6 +100,11 @@ let TimePickerPage = React.createClass({
desc: 'Callback function that is fired when the timepicker field ' +
'gains focus.',
},
{
name: 'onShow',
header: 'function()',
desc: 'Fired when the timepicker dialog is dismissed.',
},
{
name: 'onShow',
header: 'function()',
Expand Down
7 changes: 7 additions & 0 deletions src/time-picker/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ const TimePicker = React.createClass({
this.refs.input.setValue(this.formatTime(t));
},

/**
* Alias for `openDialog()` for an api consistent with TextField.
*/
focus() {
this.openDialog();
},

openDialog() {
this.setState({
dialogTime: this.getTime(),
Expand Down

0 comments on commit 0d768e5

Please sign in to comment.