From 3aee31fd7b7fcf6551282944b89635c169b0c25f Mon Sep 17 00:00:00 2001 From: Ivan Zusko Date: Sun, 22 Jan 2017 00:56:45 +0200 Subject: [PATCH] Fixes for code style consistency --- src/Select.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Select.js b/src/Select.js index bfeefc7554..c8b36c9c05 100644 --- a/src/Select.js +++ b/src/Select.js @@ -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); @@ -186,7 +186,7 @@ const Select = React.createClass({ } }, - componentWillReceiveProps(nextProps) { + componentWillReceiveProps (nextProps) { const valueArray = this.getValueArray(nextProps.value, nextProps); if (nextProps.required) { @@ -237,7 +237,7 @@ const Select = React.createClass({ } }, - componentWillUnmount() { + componentWillUnmount () { if (!document.removeEventListener && document.detachEvent) { document.detachEvent('ontouchstart', this.handleTouchOutside); } else { @@ -245,7 +245,7 @@ const Select = React.createClass({ } }, - toggleTouchOutsideEvent(enabled) { + toggleTouchOutsideEvent (enabled) { if (enabled) { if (!document.addEventListener && document.attachEvent) { document.attachEvent('ontouchstart', this.handleTouchOutside); @@ -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(); @@ -279,7 +279,7 @@ const Select = React.createClass({ } }, - blurInput() { + blurInput () { if (!this.input) return; this.input.blur(); }, @@ -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); @@ -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); @@ -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, @@ -457,7 +457,7 @@ const Select = React.createClass({ this.setState({ isOpen: true, isPseudoFocused: false, - inputValue: newInputValue + inputValue: newInputValue, }); }, @@ -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) { @@ -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;