Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismcv committed Feb 8, 2016
1 parent 0a5b594 commit a9091a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/popover/popover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ const Popover = React.createClass({
const a = {
top: rect.top,
left: rect.left,
width: el.offsetWidth,
height: el.offsetHeight,
width: rect.width,
height: rect.height,
};

a.right = rect.right || a.left + a.width;
Expand Down
14 changes: 9 additions & 5 deletions src/render-to-layer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const RenderToLayer = React.createClass({
this._layer.addEventListener('touchstart', this.onClickAway);
this._layer.addEventListener('click', this.onClickAway);
this._layer.style.position = 'absolute';
this._layer.style.background = 'rgba(0,0,0,0.3)';
this._layer.style.zIndex = this.state.muiTheme.zIndex.layer;
} else {
setTimeout(() => {
Expand All @@ -139,11 +140,14 @@ const RenderToLayer = React.createClass({
}, 0);
}
}

this._layer.style.top = document.body.scrollTop + 'px';
this._layer.style.height = document.body.clientHeight + 'px';
this._layer.style.left = document.body.scrollLeft + 'px';
this._layer.style.width = document.body.clientWidth + 'px';
const {documentElement, body} = document;
const top = window.pageYOffset || documentElement.scrollTop || body.scrollTop || 0;
const left = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft || 0;

this._layer.style.top = `${top}px`;
this._layer.style.height = `${body.clientHeight}px`;
this._layer.style.left = `${left}px`;
this._layer.style.width = `${body.clientWidth}px`;
// By calling this method in componentDidMount() and
// componentDidUpdate(), you're effectively creating a "wormhole" that
// funnels React's hierarchical updates through to a DOM node on an
Expand Down

0 comments on commit a9091a4

Please sign in to comment.