mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 02:10:55 +00:00
Unbreak tab complete...
This commit is contained in:
parent
d22d9b22b1
commit
570db98548
1 changed files with 6 additions and 5 deletions
|
@ -17,6 +17,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('RoomController')
|
angular.module('RoomController')
|
||||||
|
// XXX FIXME : This has tight coupling with $scope.room.now.members
|
||||||
.directive('tabComplete', ['$timeout', function ($timeout) {
|
.directive('tabComplete', ['$timeout', function ($timeout) {
|
||||||
return function (scope, element, attrs) {
|
return function (scope, element, attrs) {
|
||||||
element.bind("keydown keypress", function (event) {
|
element.bind("keydown keypress", function (event) {
|
||||||
|
@ -80,16 +81,16 @@ angular.module('RoomController')
|
||||||
var expansion;
|
var expansion;
|
||||||
|
|
||||||
// FIXME: could do better than linear search here
|
// FIXME: could do better than linear search here
|
||||||
angular.forEach(scope.members, function(item, name) {
|
angular.forEach(scope.room.now.members, function(item, name) {
|
||||||
if (item.displayname && searchIndex < targetIndex) {
|
if (item.event.content.displayname && searchIndex < targetIndex) {
|
||||||
if (item.displayname.toLowerCase().indexOf(search[1].toLowerCase()) === 0) {
|
if (item.event.content.displayname.toLowerCase().indexOf(search[1].toLowerCase()) === 0) {
|
||||||
expansion = item.displayname;
|
expansion = item.event.content.displayname;
|
||||||
searchIndex++;
|
searchIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (searchIndex < targetIndex) { // then search raw mxids
|
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) {
|
if (searchIndex < targetIndex) {
|
||||||
// === 1 because mxids are @username
|
// === 1 because mxids are @username
|
||||||
if (name.toLowerCase().indexOf(search[1].toLowerCase()) === 1) {
|
if (name.toLowerCase().indexOf(search[1].toLowerCase()) === 1) {
|
||||||
|
|
Loading…
Reference in a new issue