commit
b8be9732d5
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue