Comparing version 0.1.1 to 0.1.2
@@ -38,13 +38,19 @@ 'use strict'; | ||
var onMouseLeave = _props.onMouseLeave; | ||
var onTouchEnd = _props.onTouchEnd; | ||
var props = { | ||
onClick: this.props.onClick.bind(null, index + 1), | ||
className: this.isActive(index, children) ? 'active' : '' | ||
className: this.isActive(index, children) ? 'active' : '', | ||
active: this.isActive(index, children), | ||
onTouchStart: this.props.onClick.bind(null, index + 1) | ||
}; | ||
if (onMouseOver && onMouseLeave) { | ||
props.onMouseOver = onMouseOver; | ||
if (onMouseLeave) { | ||
props.onMouseLeave = onMouseLeave; | ||
} | ||
if (onTouchEnd) { | ||
props.onTouchEnd = onTouchEnd; | ||
} | ||
return props; | ||
@@ -86,2 +92,4 @@ } | ||
value: function render() { | ||
var className = 'dotslider-navigation'; | ||
if (this.props.useDefault) { | ||
@@ -91,7 +99,5 @@ return this.renderDefaultNavigator(); | ||
return _react2.default.createElement( | ||
'div', | ||
{ className: 'dotslider-navigation' }, | ||
this.renderChildren() | ||
); | ||
className = this.props.className ? className += ' ' + this.props.className : className; | ||
return _react2.default.createElement(this.props.el, { className: className }, this.renderChildren()); | ||
} | ||
@@ -103,2 +109,8 @@ }]); | ||
exports.default = Navigator; | ||
// Default Props | ||
exports.default = Navigator; | ||
Navigator.defaultProps = { | ||
el: 'div' | ||
}; |
@@ -77,4 +77,9 @@ 'use strict'; | ||
value: function handleMouseLeave() { | ||
this.stopAnimation = false; | ||
this.startAnimationLoop(); | ||
this.stopAnimationLoop(); | ||
if (this.state.isAnimating) { | ||
this.setState({ isAnimating: false }); | ||
} else { | ||
this.startAnimationLoop(); | ||
} | ||
} | ||
@@ -102,5 +107,8 @@ }, { | ||
_this2.goToSlide(number); | ||
// this.handleMouseOver(); | ||
}, | ||
getActive: this.getActive, | ||
totalChildren: this.getChildrenCount() | ||
totalChildren: this.getChildrenCount(), | ||
onMouseLeave: this.handleMouseLeave, | ||
onTouchEnd: this.handleMouseLeave | ||
}; | ||
@@ -230,6 +238,2 @@ | ||
if (this.__timeout) { | ||
clearTimeout(this.__timeout); | ||
} | ||
active = number; | ||
@@ -360,2 +364,3 @@ | ||
var dragged = this.state.dragged; | ||
if (this.touched && dragged) { | ||
@@ -398,5 +403,3 @@ if (this.touchStartPosition > dragged) { | ||
this.stopAnimation = false; | ||
if (this.touched) { | ||
return; | ||
} | ||
// if(this.touched) { return; } | ||
this.startAnimationLoop(); | ||
@@ -403,0 +406,0 @@ } |
{ | ||
"name": "dotslider", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Zero effort slider / carousel component in pure react with zero dependencies", | ||
@@ -5,0 +5,0 @@ "main": "./lib/entry.dist.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29995
671
0