зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1468953: Use node bounds in viewport instead of offsets from offsetParent. r=jdescottes
MozReview-Commit-ID: nqMLetevCZ --HG-- extra : rebase_source : 8ca955be72b36a7554024103ceede82bce0b5076
This commit is contained in:
Родитель
63dbf9d6f7
Коммит
f24d951078
|
@ -166,6 +166,7 @@ class SplitBox extends Component {
|
||||||
*/
|
*/
|
||||||
onMove(x, y) {
|
onMove(x, y) {
|
||||||
const node = ReactDOM.findDOMNode(this);
|
const node = ReactDOM.findDOMNode(this);
|
||||||
|
const nodeBounds = node.getBoundingClientRect();
|
||||||
|
|
||||||
let size;
|
let size;
|
||||||
let { endPanelControl, vert } = this.state;
|
let { endPanelControl, vert } = this.state;
|
||||||
|
@ -182,16 +183,16 @@ class SplitBox extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
size = endPanelControl ?
|
size = endPanelControl ?
|
||||||
(node.offsetLeft + node.offsetWidth) - x :
|
(nodeBounds.left + nodeBounds.width) - x :
|
||||||
x - node.offsetLeft;
|
x - nodeBounds.left;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
width: size
|
width: size
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
size = endPanelControl ?
|
size = endPanelControl ?
|
||||||
(node.offsetTop + node.offsetHeight) - y :
|
(nodeBounds.top + nodeBounds.height) - y :
|
||||||
y - node.offsetTop;
|
y - nodeBounds.top;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
height: size
|
height: size
|
||||||
|
|
Загрузка…
Ссылка в новой задаче