Skip to content

Commit 71f5d1f

Browse files
committed
Use bind to take variable value rather than reference: make room directory able to join rooms
1 parent 4679e00 commit 71f5d1f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎skins/base/views/organisms/RoomDirectory.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module.exports = React.createClass({
9191
if (rooms[i].aliases[0]) name += " (" + rooms[i].aliases[0] + ")";
9292
}
9393
rows.unshift(
94-
<tr key={ rooms[i].room_id } onClick={ function() { self.joinRoom(rooms[i].room_id); } }>
94+
<tr key={ rooms[i].room_id } onClick={self.joinRoom.bind(null, rooms[i].room_id)}>
9595
<td><img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/> { name }</td>
9696
<td>{ rooms[i].topic }</td>
9797
<td style={ {'text-align' : 'center'} }>{ rooms[i].num_joined_members }</td>

0 commit comments

Comments
 (0)