Further tweaks to the tooltip to better handle its position, and simplify it's use
This commit is contained in:
parent
bffefd9261
commit
405dcf76eb
2 changed files with 6 additions and 13 deletions
|
@ -77,9 +77,6 @@ module.exports = React.createClass({
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'view_tooltip':
|
case 'view_tooltip':
|
||||||
this.tooltip = payload.tooltip;
|
this.tooltip = payload.tooltip;
|
||||||
this.tooltipParent = payload.parent;
|
|
||||||
this._repositionTooltip();
|
|
||||||
if (this.tooltip) this.tooltip.style.display = 'block';
|
|
||||||
break;
|
break;
|
||||||
case 'call_state':
|
case 'call_state':
|
||||||
var call = CallHandler.getCall(payload.room_id);
|
var call = CallHandler.getCall(payload.room_id);
|
||||||
|
@ -270,15 +267,15 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_whenScrolling: function(e) {
|
_whenScrolling: function(e) {
|
||||||
this._repositionTooltip(e);
|
this._hideTooltip(e);
|
||||||
this._repositionIncomingCallBox(e, false);
|
this._repositionIncomingCallBox(e, false);
|
||||||
this._updateStickyHeaders(false);
|
this._updateStickyHeaders(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
_repositionTooltip: function(e) {
|
_hideTooltip: function(e) {
|
||||||
if (this.tooltip && this.tooltipParent) {
|
// Hide tooltip when scrolling, as we'll no longer be over the one we were on
|
||||||
this.tooltip.style.top = this.tooltipParent.getBoundingClientRect().top + "px";
|
if (this.tooltip && this.tooltip.style.display !== "none") {
|
||||||
this.tooltip.style.left = this.tooltipParent.getBoundingClientRect().right + "px";
|
this.tooltip.style.display = "none";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,6 @@ module.exports = React.createClass({
|
||||||
MatrixClientPeg.get().on("accountData", this.onAccountData);
|
MatrixClientPeg.get().on("accountData", this.onAccountData);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
|
||||||
this.componentElement = ReactDOM.findDOMNode(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
var cli = MatrixClientPeg.get();
|
var cli = MatrixClientPeg.get();
|
||||||
if (cli) {
|
if (cli) {
|
||||||
|
@ -253,7 +249,7 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
else if (this.state.hover) {
|
else if (this.state.hover) {
|
||||||
var RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
|
var RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
|
||||||
label = <RoomTooltip room={this.props.room} parent={this.componentElement} />;
|
label = <RoomTooltip room={this.props.room} parent={this} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
var incomingCallBox;
|
var incomingCallBox;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue