Make indenting lines after the first work with the new message rendering

This commit is contained in:
khlieng 2015-02-21 06:25:52 +01:00
parent 305ee753e3
commit 14dee89304
4 changed files with 21 additions and 7 deletions

View file

@ -10,7 +10,7 @@ var Chat = React.createClass({
return (
<div>
<ChatTitle />
<MessageBox />
<MessageBox indent={window.messageIndent} />
<MessageInput />
<UserList />
</div>

View file

@ -64,6 +64,9 @@ var MessageBox = React.createClass({
var dest = tab.channel || tab.server;
var lines = [];
var style = {};
var innerStyle = {
paddingLeft: this.props.indent + 'px'
};
if (!tab.channel || tab.channel[0] !== '#') {
style.right = 0;
@ -88,7 +91,7 @@ var MessageBox = React.createClass({
for (var i = 1; i < message.lines.length; i++) {
lines.push(
<p key={key + '-' + i} className={messageClass}>
<p key={key + '-' + i} className={messageClass} style={innerStyle}>
<span dangerouslySetInnerHTML={{ __html: Autolinker.link(message.lines[i]) }}></span>
</p>
);