Tweak of the RoomTooltip to use DOM element for the parent rather than a React component

pull/21833/head
wmwragg 2016-09-02 18:41:44 +01:00
parent 4c05edb71b
commit bffefd9261
1 changed files with 6 additions and 1 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
'use strict';
var React = require('react');
var ReactDOM = require("react-dom");
var classNames = require('classnames');
var dis = require("../../../dispatcher");
var MatrixClientPeg = require('../../../MatrixClientPeg');
@ -75,6 +76,10 @@ module.exports = React.createClass({
MatrixClientPeg.get().on("accountData", this.onAccountData);
},
componentDidMount: function() {
this.componentElement = ReactDOM.findDOMNode(this);
},
componentWillUnmount: function() {
var cli = MatrixClientPeg.get();
if (cli) {
@ -248,7 +253,7 @@ module.exports = React.createClass({
}
else if (this.state.hover) {
var RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
label = <RoomTooltip room={this.props.room} component={this} />;
label = <RoomTooltip room={this.props.room} parent={this.componentElement} />;
}
var incomingCallBox;