2016-02-27 11:17:11 +08:00
|
|
|
PrivateChatToolBar = React.createClass({
|
|
|
|
componentDidMount: function() {
|
|
|
|
if(isLandscape() || isPortrait()) {
|
|
|
|
return $("#newMessageInput").focus();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
handleClick: function() {
|
|
|
|
console.log("I'm in the handleClick function");
|
|
|
|
setInSession('inChatWith', 'PUBLIC_CHAT');
|
|
|
|
return setInSession('chats', getInSession('chats').map(chat => {
|
|
|
|
if(chat.userId === "PUBLIC_CHAT") {
|
|
|
|
chat.gotMail = false;
|
|
|
|
chat.number = 0;
|
|
|
|
}
|
|
|
|
return chat;
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
render(){
|
|
|
|
return (
|
|
|
|
<div className="privateChatTab">
|
2016-03-12 07:04:44 +08:00
|
|
|
<Button onClick={this.handleClick} id="close" btn_class=" secondary tiny toPublic " i_class="ion-ios-arrow-left" rel="tooltip"
|
2016-02-27 11:17:11 +08:00
|
|
|
data_placement="bottom" title="Back to public" label="Public" notification="PUBLIC_CHAT" />
|
|
|
|
<div className="privateChatName">
|
|
|
|
{this.props.privateChatName}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|