wire up searchbox filtering

This commit is contained in:
Matthew Hodgson 2016-04-15 17:55:00 +01:00
parent 7c8d7e5361
commit a06b420942
2 changed files with 15 additions and 19 deletions

View File

@ -24,6 +24,7 @@ const KEY_WINDOWS = 91;
module.exports = React.createClass({
displayName: 'EditableText',
propTypes: {
onValueChanged: React.PropTypes.func,
initialValue: React.PropTypes.string,

View File

@ -34,7 +34,8 @@ module.exports = React.createClass({
propTypes: {
ConferenceHandler: React.PropTypes.any,
collapsed: React.PropTypes.bool,
currentRoom: React.PropTypes.string
currentRoom: React.PropTypes.string,
searchFilter: React.PropTypes.string,
},
getInitialState: function() {
@ -312,12 +313,6 @@ module.exports = React.createClass({
}
},
onShowClick: function() {
dis.dispatch({
action: 'show_left_panel',
});
},
onShowMoreRooms: function() {
// kick gemini in the balls to get it to wake up
// XXX: uuuuuuugh.
@ -325,18 +320,12 @@ module.exports = React.createClass({
},
render: function() {
var expandButton = this.props.collapsed ?
<img className="mx_RoomList_expandButton" onClick={ this.onShowClick } src="img/menu.png" width="20" alt=">"/> :
null;
var RoomSubList = sdk.getComponent('structures.RoomSubList');
var self = this;
return (
<GeminiScrollbar className="mx_RoomList_scrollbar" autoshow={true} onScroll={ self._repositionTooltips } ref="gemscroll">
<div className="mx_RoomList">
{ expandButton }
<RoomSubList list={ self.state.lists['im.vector.fake.invite'] }
label="Invites"
editable={ false }
@ -344,7 +333,8 @@ module.exports = React.createClass({
selectedRoom={ self.props.selectedRoom }
incomingCall={ self.state.incomingCall }
collapsed={ self.props.collapsed }
onShowMoreRooms={ this.onShowMoreRooms } />
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
<RoomSubList list={ self.state.lists['m.favourite'] }
label="Favourites"
@ -355,7 +345,8 @@ module.exports = React.createClass({
selectedRoom={ self.props.selectedRoom }
incomingCall={ self.state.incomingCall }
collapsed={ self.props.collapsed }
onShowMoreRooms={ this.onShowMoreRooms } />
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
<RoomSubList list={ self.state.lists['im.vector.fake.recent'] }
label="Rooms"
@ -365,7 +356,8 @@ module.exports = React.createClass({
selectedRoom={ self.props.selectedRoom }
incomingCall={ self.state.incomingCall }
collapsed={ self.props.collapsed }
onShowMoreRooms={ this.onShowMoreRooms } />
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
{ Object.keys(self.state.lists).map(function(tagName) {
if (!tagName.match(/^(m\.(favourite|lowpriority)|im\.vector\.fake\.(invite|recent|archived))$/)) {
@ -379,6 +371,7 @@ module.exports = React.createClass({
selectedRoom={ self.props.selectedRoom }
incomingCall={ self.state.incomingCall }
collapsed={ self.props.collapsed }
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
}
@ -393,7 +386,8 @@ module.exports = React.createClass({
selectedRoom={ self.props.selectedRoom }
incomingCall={ self.state.incomingCall }
collapsed={ self.props.collapsed }
onShowMoreRooms={ this.onShowMoreRooms } />
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
<RoomSubList list={ self.state.lists['im.vector.fake.archived'] }
label="Historical"
@ -406,7 +400,8 @@ module.exports = React.createClass({
showSpinner={ self.state.isLoadingLeftRooms }
onHeaderClick= { self.onArchivedHeaderClick }
incomingCall={ self.state.incomingCall }
onShowMoreRooms={ this.onShowMoreRooms } />
searchFilter={ self.props.searchFilter }
onShowMoreRooms={ self.onShowMoreRooms } />
</div>
</GeminiScrollbar>
);