mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-26 22:31:08 +00:00
Fix word wrapping and groundwork for loading previous messages
This commit is contained in:
parent
84b2549cb5
commit
215cdc7a98
2 changed files with 21 additions and 1 deletions
|
@ -38,6 +38,12 @@ var Chatroom = React.createClass({
|
||||||
socket.emit("message:refresh", {});
|
socket.emit("message:refresh", {});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadMoreMessages() {
|
||||||
|
socket.emit("message:refresh", {
|
||||||
|
// before:
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
sendMessage(message) {
|
sendMessage(message) {
|
||||||
socket.emit("newMessage", {message: message});
|
socket.emit("newMessage", {message: message});
|
||||||
},
|
},
|
||||||
|
@ -58,6 +64,12 @@ var Chatroom = React.createClass({
|
||||||
<div className="panel-heading">Gather Chat</div>
|
<div className="panel-heading">Gather Chat</div>
|
||||||
<div className="panel-body">
|
<div className="panel-body">
|
||||||
<ul className="chat" id="chatmessages" ref="messageContainer">
|
<ul className="chat" id="chatmessages" ref="messageContainer">
|
||||||
|
<li className="text-center">
|
||||||
|
<a href="#"
|
||||||
|
className="btn btn-primary btn-xs">
|
||||||
|
Load more messages
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{messages}
|
{messages}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -132,7 +144,7 @@ var ChatMessage = React.createClass({
|
||||||
{this.state.createdAt}
|
{this.state.createdAt}
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<p>{this.messageContent()}</p>
|
<p className="wordwrap">{this.messageContent()}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,6 +8,14 @@ html, body {
|
||||||
|
|
||||||
/*Chat*/
|
/*Chat*/
|
||||||
|
|
||||||
|
.wordwrap {
|
||||||
|
white-space: pre-wrap; /* CSS3 */
|
||||||
|
white-space: -moz-pre-wrap; /* Firefox */
|
||||||
|
white-space: -pre-wrap; /* Opera <7 */
|
||||||
|
white-space: -o-pre-wrap; /* Opera 7 */
|
||||||
|
word-wrap: break-word; /* IE */
|
||||||
|
}
|
||||||
|
|
||||||
#chatroom {
|
#chatroom {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue