Skip to content

Commit

Permalink
Show timestamp when you hover over a message
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 22, 2015
1 parent fbb6775 commit c726257
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion skins/base/css/molecules/MessageTile.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.
padding-right: 12px;
margin-left: -64px;
margin-top: -7px;
float: left;
float: left;
}

.mx_MessageTile_avatar img {
Expand Down Expand Up @@ -78,3 +78,15 @@ limitations under the License.
.mx_MessageTile_msgOption {
float: right;
}

.mx_MessageTimestamp {
display: none;
}

.mx_MessageTile_last .mx_MessageTimestamp {
display: block;
}

.mx_MessageTile:hover .mx_MessageTimestamp {
display: block;
}
4 changes: 2 additions & 2 deletions skins/base/views/molecules/MessageTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ module.exports = React.createClass({
mx_MessageTile_notSent: this.props.mxEvent.status == 'not_sent',
mx_MessageTile_highlight: this.shouldHighlight(),
mx_MessageTile_continuation: this.props.continuation,
mx_MessageTile_last: this.props.last
});
var timestamp = this.props.last ? <MessageTimestamp ts={this.props.mxEvent.getTs()} /> : null;
var timestamp = <MessageTimestamp ts={this.props.mxEvent.getTs()} />
var avatar, sender, resend;
if (!this.props.continuation) {
avatar = (
Expand All @@ -84,4 +85,3 @@ module.exports = React.createClass({
);
},
});

3 comments on commit c726257

@ara4n
Copy link
Member

@ara4n ara4n commented on c726257 Jul 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still always show the most recent timestamp. Using :hover is risky as you have to hover in precisely the right place and can only see one timestamp at a time. I'd suggest that we do onMouseEnter for the whole messagepanel to show them, as we do on angular.

@erikjohnston
Copy link
Member Author

@erikjohnston erikjohnston commented on c726257 Jul 24, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ara4n
Copy link
Member

@ara4n ara4n commented on c726257 Jul 24, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.