Skip to content

Commit

Permalink
Merge pull request JedWatson#1496 from ivanzusko/patch-1
Browse files Browse the repository at this point in the history
Fixes for code style consistency
  • Loading branch information
JedWatson authored Jan 31, 2017
2 parents ca217b9 + 3aee31f commit 350354c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const Select = React.createClass({
};
},

componentWillMount() {
componentWillMount () {
this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-';
const valueArray = this.getValueArray(this.props.value);

Expand All @@ -186,7 +186,7 @@ const Select = React.createClass({
}
},

componentWillReceiveProps(nextProps) {
componentWillReceiveProps (nextProps) {
const valueArray = this.getValueArray(nextProps.value, nextProps);

if (nextProps.required) {
Expand Down Expand Up @@ -237,15 +237,15 @@ const Select = React.createClass({
}
},

componentWillUnmount() {
componentWillUnmount () {
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
},

toggleTouchOutsideEvent(enabled) {
toggleTouchOutsideEvent (enabled) {
if (enabled) {
if (!document.addEventListener && document.attachEvent) {
document.attachEvent('ontouchstart', this.handleTouchOutside);
Expand All @@ -261,7 +261,7 @@ const Select = React.createClass({
}
},

handleTouchOutside(event) {
handleTouchOutside (event) {
// handle touch outside on ios to dismiss menu
if (this.wrapper && !this.wrapper.contains(event.target)) {
this.closeMenu();
Expand All @@ -279,7 +279,7 @@ const Select = React.createClass({
}
},

blurInput() {
blurInput () {
if (!this.input) return;
this.input.blur();
},
Expand All @@ -297,7 +297,7 @@ const Select = React.createClass({
handleTouchEnd (event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if(this.dragging) return;
if (this.dragging) return;

// Fire the mouse events
this.handleMouseDown(event);
Expand All @@ -306,7 +306,7 @@ const Select = React.createClass({
handleTouchEndClearValue (event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if(this.dragging) return;
if (this.dragging) return;

// Clear the value
this.clearValue(event);
Expand Down Expand Up @@ -399,7 +399,7 @@ const Select = React.createClass({
isPseudoFocused: this.state.isFocused && !this.props.multi,
inputValue: ''
});
} else {
} else {
this.setState({
isOpen: false,
isPseudoFocused: this.state.isFocused && !this.props.multi,
Expand Down Expand Up @@ -457,7 +457,7 @@ const Select = React.createClass({
this.setState({
isOpen: true,
isPseudoFocused: false,
inputValue: newInputValue
inputValue: newInputValue,
});
},

Expand Down Expand Up @@ -660,7 +660,7 @@ const Select = React.createClass({
}, this.focus);
},

getResetValue() {
getResetValue () {
if (this.props.resetValue !== undefined) {
return this.props.resetValue;
} else if (this.props.multi) {
Expand Down Expand Up @@ -735,14 +735,14 @@ const Select = React.createClass({
focusedIndex = options.length - 1;
} else if (dir === 'page_up') {
var potentialIndex = focusedIndex - this.props.pageSize;
if ( potentialIndex < 0 ) {
if (potentialIndex < 0) {
focusedIndex = 0;
} else {
focusedIndex = potentialIndex;
}
} else if (dir === 'page_down') {
var potentialIndex = focusedIndex + this.props.pageSize;
if ( potentialIndex > options.length - 1 ) {
if (potentialIndex > options.length - 1) {
focusedIndex = options.length - 1;
} else {
focusedIndex = potentialIndex;
Expand Down

0 comments on commit 350354c

Please sign in to comment.