Merge pull request #682 from jcullen/bugfix/ripple

Bugfix for IE scrollX/scrollY
old
Javi Velasco 2016-08-03 10:02:53 +02:00 committed by GitHub
commit b8be9732d5
4 changed files with 6 additions and 6 deletions

View File

@ -95,8 +95,8 @@ const rippleFactory = (options = {}) => {
const {left, top, height, width} = ReactDOM.findDOMNode(this).getBoundingClientRect();
const {rippleCentered: centered, rippleSpread: spread} = this.props;
return {
left: centered ? 0 : pageX - left - width / 2 - window.scrollX,
top: centered ? 0 : pageY - top - height / 2 - window.scrollY,
left: centered ? 0 : pageX - left - width / 2 - window.pageXOffset,
top: centered ? 0 : pageY - top - height / 2 - window.pageYOffset,
width: width * spread
};
}

View File

@ -58,7 +58,7 @@ class Clock extends Component {
handleCalculateShape = () => {
const { top, left, width } = this.refs.placeholder.getBoundingClientRect();
this.setState({
center: { x: left + width / 2 - window.scrollX, y: top + width / 2 - window.scrollX },
center: { x: left + width / 2 - window.pageXOffset, y: top + width / 2 - window.pageXOffset },
radius: width / 2
});
};

View File

@ -150,8 +150,8 @@ var rippleFactory = function rippleFactory() {
var spread = _props.rippleSpread;
return {
left: centered ? 0 : pageX - left - width / 2 - window.scrollX,
top: centered ? 0 : pageY - top - height / 2 - window.scrollY,
left: centered ? 0 : pageX - left - width / 2 - window.pageXOffset,
top: centered ? 0 : pageY - top - height / 2 - window.pageYOffset,
width: width * spread
};
}

View File

@ -69,7 +69,7 @@ var Clock = function (_Component) {
var width = _this$refs$placeholde.width;
_this.setState({
center: { x: left + width / 2 - window.scrollX, y: top + width / 2 - window.scrollX },
center: { x: left + width / 2 - window.pageXOffset, y: top + width / 2 - window.pageXOffset },
radius: width / 2
});
}, _temp), _possibleConstructorReturn(_this, _ret);