@@ -17,6 +17,7 @@ limitations under the License.
1717'use strict' ;
1818
1919var React = require ( 'react' ) ;
20+ var classNames = require ( 'classnames' ) ;
2021
2122var MemberListController = require ( "../../../../src/controllers/organisms/MemberList" ) ;
2223
@@ -30,6 +31,10 @@ module.exports = React.createClass({
3031 displayName : 'MemberList' ,
3132 mixins : [ MemberListController ] ,
3233
34+ getInitialState : function ( ) {
35+ return { editing : false } ;
36+ } ,
37+
3338 // FIXME: combine this more nicely with the MemberInfo positioning stuff...
3439 onMemberListScroll : function ( ev ) {
3540 if ( this . refs . memberListScroll ) {
@@ -55,23 +60,40 @@ module.exports = React.createClass({
5560 onPopulateInvite : function ( inputText , shouldSubmit ) {
5661 // reset back to placeholder
5762 this . refs . invite . setValue ( "Invite" , false , true ) ;
63+ this . setState ( { editing : false } ) ;
5864 if ( ! shouldSubmit ) {
5965 return ; // enter key wasn't pressed
6066 }
6167 this . onInvite ( inputText ) ;
6268 } ,
6369
70+ onClickInvite : function ( ev ) {
71+ this . setState ( { editing : true } ) ;
72+ this . refs . invite . onClickDiv ( ) ;
73+ console . log ( "forcing update on memberlist after having clicked invite" ) ;
74+ ev . stopPropagation ( ) ;
75+ ev . preventDefault ( ) ;
76+ } ,
77+
6478 inviteTile : function ( ) {
65- if ( this . state . inviting ) {
66- return (
67- < div > </ div >
68- ) ;
69- }
79+ // if (this.state.inviting) {
80+ // return (
81+ // <div></div>
82+ // );
83+ // }
84+
85+ var classes = classNames ( {
86+ mx_MemberTile : true ,
87+ mx_MemberTile_inviteEditing : this . state . editing ,
88+ } ) ;
89+
90+ console . log ( "rendering inviteTile, with phase as " + ( this . refs . invite ? this . refs . invite . state . phase : "unknown" ) ) ;
91+
7092 return (
71- < div className = "mx_MemberTile" >
93+ < div className = { classes } onClick = { this . onClickInvite } >
7294 < div className = "mx_MemberTile_avatar" > < img src = "img/create-big.png" width = "40" height = "40" alt = "" /> </ div >
7395 < div className = "mx_MemberTile_name" >
74- < EditableText ref = "invite" placeHolder = "Invite" onValueChanged = { this . onPopulateInvite } />
96+ < EditableText ref = "invite" label = "Invite" placeHolder = "@user:domain.com" initialValue = " " onValueChanged = { this . onPopulateInvite } />
7597 </ div >
7698 </ div >
7799 ) ;
0 commit comments