Skip to content

Commit

Permalink
Replace arrow functions with es5 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpowaga committed Mar 29, 2018
1 parent a0b8711 commit 47a50a7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions react-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,13 +737,16 @@
},

_renderHandle: function (style, child, i) {
var self = this;
var className = this.props.handleClassName + ' ' +
(this.props.handleClassName + '-' + i) + ' ' +
(this.state.index === i ? this.props.handleActiveClassName : '');

return (
React.createElement('div', {
ref: r => (this['handle' + i] = r),
ref: function (r) {
self['handle' + i] = r;
},
key: 'handle' + i,
className: className,
style: style,
Expand Down Expand Up @@ -786,10 +789,13 @@
},

_renderBar: function (i, offsetFrom, offsetTo) {
var self = this;
return (
React.createElement('div', {
key: 'bar' + i,
ref: r => (this['bar' + i] = r),
ref: function (r) {
self['bar' + i] = r;
},
className: this.props.barClassName + ' ' + this.props.barClassName + '-' + i,
style: this._buildBarStyle(offsetFrom, this.state.upperBound - offsetTo)
})
Expand Down Expand Up @@ -843,6 +849,7 @@
},

render: function () {
var self = this;
var state = this.state;
var props = this.props;

Expand All @@ -858,7 +865,9 @@

return (
React.createElement('div', {
ref: r => (this.slider = r),
ref: function (r) {
self.slider = r;
},
style: {position: 'relative'},
className: props.className + (props.disabled ? ' disabled' : ''),
onMouseDown: this._onSliderMouseDown,
Expand Down

0 comments on commit 47a50a7

Please sign in to comment.