Comparing version 5.4.1 to 5.4.2
@@ -49,2 +49,3 @@ 'use strict'; | ||
} | ||
var navNode = this.refs.nav; | ||
@@ -56,21 +57,19 @@ var navNodeWH = this.getOffsetWH(navNode); | ||
var offset = state.offset; | ||
if (navWrapNodeWH - offset < navNodeWH) { | ||
if (!state.next) { | ||
this.setNext(true); | ||
} | ||
var minOffset = navWrapNodeWH - navNodeWH; | ||
if (minOffset >= 0) { | ||
this.setNext(false); | ||
this.setOffset(0); | ||
offset = 0; | ||
} else if (minOffset < offset) { | ||
this.setNext(true); | ||
} else { | ||
var minOffset = navWrapNodeWH - navNodeWH; | ||
if (minOffset < 0 && minOffset > offset) { | ||
if (state.next) { | ||
this.setNext(false); | ||
} | ||
this.setOffset(minOffset); | ||
offset = minOffset; | ||
} | ||
this.setNext(false); | ||
this.setOffset(minOffset); | ||
offset = minOffset; | ||
} | ||
if (offset < 0) { | ||
if (!state.prev) { | ||
this.setPrev(true); | ||
} | ||
} else if (state.prev) { | ||
this.setPrev(true); | ||
} else { | ||
this.setPrev(false); | ||
@@ -214,5 +213,8 @@ } | ||
setOffset: function setOffset(offset) { | ||
this.setState({ | ||
offset: Math.min(0, offset) | ||
}); | ||
var target = Math.min(0, offset); | ||
if (this.state.offset !== target) { | ||
this.setState({ | ||
offset: target | ||
}); | ||
} | ||
}, | ||
@@ -237,11 +239,15 @@ | ||
setPrev: function setPrev(v) { | ||
this.setState({ | ||
prev: v | ||
}); | ||
if (this.state.prev !== v) { | ||
this.setState({ | ||
prev: v | ||
}); | ||
} | ||
}, | ||
setNext: function setNext(v) { | ||
this.setState({ | ||
next: v | ||
}); | ||
if (this.state.next !== v) { | ||
this.setState({ | ||
next: v | ||
}); | ||
} | ||
} | ||
@@ -248,0 +254,0 @@ }); |
{ | ||
"name": "rc-tabs", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "tabs ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
38785
11
1111
0
186