forked from matrix/element-web
Removed nolonger needed conditional test, as the parent will always exist
This commit is contained in:
parent
cb98e2421e
commit
7ae821e2b5
|
@ -69,12 +69,11 @@ module.exports = React.createClass({
|
||||||
if (this.props.left) { style.left = this.props.left; }
|
if (this.props.left) { style.left = this.props.left; }
|
||||||
if (this.props.right) { style.right = this.props.right; }
|
if (this.props.right) { style.right = this.props.right; }
|
||||||
|
|
||||||
// If a parent exists, add the parent's position to the tooltips, so it's correctly
|
// Add the parent's position to the tooltips, so it's correctly
|
||||||
// positioned, also taking into account any window zoom
|
// positioned, also taking into account any window zoom
|
||||||
// NOTE: The additional 6 pixels for the left position, is to take account of the
|
// NOTE: The additional 6 pixels for the left position, is to take account of the
|
||||||
// tooltips chevron
|
// tooltips chevron
|
||||||
var parent = ReactDOM.findDOMNode(this).parentElement;
|
var parent = ReactDOM.findDOMNode(this).parentElement;
|
||||||
if (parent) {
|
|
||||||
style.top = (+style.top || 0) + parent.getBoundingClientRect().top + window.pageYOffset;
|
style.top = (+style.top || 0) + parent.getBoundingClientRect().top + window.pageYOffset;
|
||||||
style.left = (+style.left || 0) + 6 + parent.getBoundingClientRect().right + window.pageXOffset;
|
style.left = (+style.left || 0) + 6 + parent.getBoundingClientRect().right + window.pageXOffset;
|
||||||
style.display = "block";
|
style.display = "block";
|
||||||
|
@ -95,7 +94,6 @@ module.exports = React.createClass({
|
||||||
tooltip: this.tooltip,
|
tooltip: this.tooltip,
|
||||||
parent: parent,
|
parent: parent,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
Loading…
Reference in New Issue