Skip to content

Commit

Permalink
autoOk added to docs, missing comma, const
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfoo committed Oct 22, 2015
1 parent d0ed1db commit bd0eb61
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions docs/src/app/components/pages/components/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ let TimePickerPage = React.createClass({
{
name: 'Props',
infoArray: [
{
name: 'autoOk',
type: 'boolean',
header: 'default: false',
desc: 'If true, automatically accept and close the picker on set minutes.',
},
{
name: 'defaultTime',
type: 'date object',
Expand Down Expand Up @@ -113,6 +119,12 @@ let TimePickerPage = React.createClass({
format="24hr"
hintText="24hr Format"
onChange={this._changeTimePicker12} />

<TimePicker
ref="pickerAutoOk"
format="24hr"
hintText="AutoOk"
autoOk={true} />
</CodeExample>
</ComponentDoc>
);
Expand Down
5 changes: 5 additions & 0 deletions docs/src/app/components/raw-code/time-picker-code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
<TimePicker
format="24hr"
hintText="24hr Format" />

//Auto OK
<TimePicker
hintText="AutoOk"
autoOk={true} />
2 changes: 1 addition & 1 deletion src/time-picker/clock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const Clock = React.createClass({

const { onChangeMinutes } = this.props;
if (typeof(onChangeMinutes) === 'function') {
onChangeMinutes(time);
setTimeout(() => { onChangeMinutes(time); }, 0);
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/time-picker/time-picker-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const TimePickerDialog = React.createClass({
onTouchTap={this._handleOKTouchTap} />,
];

let onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined);
const onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined);

return (
<Dialog {...other}
Expand Down

0 comments on commit bd0eb61

Please sign in to comment.