Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b617571

Browse files
committed
tidy up #225
1 parent e03d862 commit b617571

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/components/views/rooms/EventTile.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ module.exports = React.createClass({
268268
this.readAvatarNode = ReactDom.findDOMNode(node);
269269
},
270270

271+
onMemberAvatarClicked: function(sender) {
272+
dispatcher.dispatch({
273+
action: 'view_user',
274+
member: sender
275+
});
276+
},
277+
271278
render: function() {
272279
var MessageTimestamp = sdk.getComponent('messages.MessageTimestamp');
273280
var SenderProfile = sdk.getComponent('messages.SenderProfile');
@@ -305,23 +312,13 @@ module.exports = React.createClass({
305312

306313
var readAvatars = this.getReadAvatars();
307314

308-
function onMemberAvatarClicked(sender) {
309-
return () => {
310-
//var member = new Matrix.RoomMember(null, userId);
311-
//if (!member) { return; }
312-
dispatcher.dispatch({
313-
action: 'view_user',
314-
member: sender
315-
});
316-
};
317-
}
318-
319315
var avatar, sender;
320316
if (!this.props.continuation) {
321317
if (this.props.mxEvent.sender) {
322318
avatar = (
323-
<div className="mx_EventTile_avatar" style={{cursor: "pointer"}}>
324-
<MemberAvatar member={this.props.mxEvent.sender} width={24} height={24} onClick={onMemberAvatarClicked(this.props.mxEvent.sender)} />
319+
<div className="mx_EventTile_avatar">
320+
<MemberAvatar member={this.props.mxEvent.sender} width={24} height={24}
321+
onClick={ this.onMemberAvatarClicked.bind(this, this.props.mxEvent.sender) } />
325322
</div>
326323
);
327324
}

0 commit comments

Comments
 (0)