summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-14 17:01:09 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-14 17:01:09 +0000
commit570db98548282d0d41ea573f9666fa9d7755e8ba (patch)
tree636275683ad45a4c0ae51fbb3e84aa7e1809b737
parentAdd more modelService unit tests. (diff)
downloadsynapse-570db98548282d0d41ea573f9666fa9d7755e8ba.tar.xz
Unbreak tab complete...
-rw-r--r--syweb/webclient/room/room-directive.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/syweb/webclient/room/room-directive.js b/syweb/webclient/room/room-directive.js
index 187032aa88..4707d12c8c 100644
--- a/syweb/webclient/room/room-directive.js
+++ b/syweb/webclient/room/room-directive.js
@@ -17,6 +17,7 @@
 'use strict';
 
 angular.module('RoomController')
+// XXX FIXME : This has tight coupling with $scope.room.now.members
 .directive('tabComplete', ['$timeout', function ($timeout) {
     return function (scope, element, attrs) {
         element.bind("keydown keypress", function (event) {
@@ -80,16 +81,16 @@ angular.module('RoomController')
                     var expansion;
                     
                     // FIXME: could do better than linear search here
-                    angular.forEach(scope.members, function(item, name) {
-                        if (item.displayname && searchIndex < targetIndex) {
-                            if (item.displayname.toLowerCase().indexOf(search[1].toLowerCase()) === 0) {
-                                expansion = item.displayname;
+                    angular.forEach(scope.room.now.members, function(item, name) {
+                        if (item.event.content.displayname && searchIndex < targetIndex) {
+                            if (item.event.content.displayname.toLowerCase().indexOf(search[1].toLowerCase()) === 0) {
+                                expansion = item.event.content.displayname;
                                 searchIndex++;
                             }
                         }
                     });
                     if (searchIndex < targetIndex) { // then search raw mxids
-                        angular.forEach(scope.members, function(item, name) {
+                        angular.forEach(scope.room.now.members, function(item, name) {
                             if (searchIndex < targetIndex) {
                                 // === 1 because mxids are @username
                                 if (name.toLowerCase().indexOf(search[1].toLowerCase()) === 1) {