track RoomTile focus in RoomList, and stop the RoomList from updating during mouseOver
This commit is contained in:
parent
0a91511f05
commit
691639d1e0
2 changed files with 69 additions and 4 deletions
|
@ -35,6 +35,7 @@ module.exports = React.createClass({
|
|||
connectDragSource: React.PropTypes.func,
|
||||
connectDropTarget: React.PropTypes.func,
|
||||
onClick: React.PropTypes.func,
|
||||
onFocus: React.PropTypes.func,
|
||||
isDragging: React.PropTypes.bool,
|
||||
|
||||
room: React.PropTypes.object.isRequired,
|
||||
|
@ -104,6 +105,12 @@ module.exports = React.createClass({
|
|||
}
|
||||
},
|
||||
|
||||
onFocus: function() {
|
||||
if (this.props.onFocus) {
|
||||
this.props.onFocus(this.props.room.roomId);
|
||||
}
|
||||
},
|
||||
|
||||
onMouseEnter: function() {
|
||||
this.setState( { hover : true });
|
||||
this.badgeOnMouseEnter();
|
||||
|
@ -255,7 +262,9 @@ module.exports = React.createClass({
|
|||
|
||||
let ret = (
|
||||
<div> { /* Only native elements can be wrapped in a DnD object. */}
|
||||
<AccessibleButton className={classes} tabIndex="0" onClick={this.onClick} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
||||
<AccessibleButton className={classes} tabIndex="0" onClick={this.onClick}
|
||||
onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}
|
||||
onFocus={this.onFocus} onBlur={this.onFocus.bind(this, null)}>
|
||||
<div className={avatarClasses}>
|
||||
<div className="mx_RoomTile_avatar_container">
|
||||
<RoomAvatar room={this.props.room} width={24} height={24} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue