Style changes and improvements in autocomplete

This commit is contained in:
Aviral Dasgupta 2016-06-20 13:52:55 +05:30
parent b9d7743e5a
commit 4af983ed90
10 changed files with 135 additions and 93 deletions

View file

@ -41,6 +41,8 @@ var rate_limited_func = require('../../ratelimitedfunc');
var ObjectUtils = require('../../ObjectUtils');
var MatrixTools = require('../../MatrixTools');
import UserProvider from '../../autocomplete/UserProvider';
var DEBUG = false;
if (DEBUG) {
@ -495,21 +497,26 @@ module.exports = React.createClass({
}
},
_updateTabCompleteList: new rate_limited_func(function() {
_updateTabCompleteList: function() {
var cli = MatrixClientPeg.get();
console.log('_updateTabCompleteList');
console.log(this.state.room);
console.trace();
if (!this.state.room || !this.tabComplete) {
if (!this.state.room) {
return;
}
var members = this.state.room.getJoinedMembers().filter(function(member) {
if (member.userId !== cli.credentials.userId) return true;
});
UserProvider.getInstance().setUserList(members);
this.tabComplete.setCompletionList(
MemberEntry.fromMemberList(members).concat(
CommandEntry.fromCommands(SlashCommands.getCommandList())
)
);
}, 500),
},
componentDidUpdate: function() {
if (this.refs.roomView) {