From 71f5d1f6cb293bd9e19f114eb6e8459f9dc61237 Mon Sep 17 00:00:00 2001
From: David Baker <dave@matrix.org>
Date: Tue, 21 Jul 2015 08:05:58 -0700
Subject: [PATCH] Use bind to take variable value rather than reference: make
 room directory able to join rooms

---
 skins/base/views/organisms/RoomDirectory.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/skins/base/views/organisms/RoomDirectory.js b/skins/base/views/organisms/RoomDirectory.js
index 7ffb4977ad..eb5ea3deeb 100644
--- a/skins/base/views/organisms/RoomDirectory.js
+++ b/skins/base/views/organisms/RoomDirectory.js
@@ -91,7 +91,7 @@ module.exports = React.createClass({
                 if (rooms[i].aliases[0]) name += " (" + rooms[i].aliases[0] + ")";
             }
             rows.unshift(
-                <tr key={ rooms[i].room_id } onClick={ function() { self.joinRoom(rooms[i].room_id); } }>
+                <tr key={ rooms[i].room_id } onClick={self.joinRoom.bind(null, rooms[i].room_id)}>
                     <td><img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/> { name }</td>
                     <td>{ rooms[i].topic }</td>
                     <td style={ {'text-align' : 'center'} }>{ rooms[i].num_joined_members }</td>
-- 
GitLab