Merge pull request #734 from mattermost/plt-206

PLT-206 Fix first channel load scrolling issue on Windows and iOS and add emoji to RHS.
This commit is contained in:
Christopher Speller
2015-09-21 12:19:57 -04:00
4 changed files with 7 additions and 3 deletions

View File

@@ -35,9 +35,7 @@ export default class PostBody extends React.Component {
parseEmojis() {
twemoji.parse(React.findDOMNode(this), {size: Constants.EMOJI_SIZE});
this.getAllChildNodes(React.findDOMNode(this)).forEach((current) => {
global.window.emojify.run(current);
});
global.window.emojify.run(React.findDOMNode(this.refs.message_span));
}
componentDidMount() {
@@ -161,6 +159,7 @@ export default class PostBody extends React.Component {
>
{loading}
<span
ref='message_span'
onClick={TextFormatting.handleClick}
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}
/>

View File

@@ -83,6 +83,7 @@ export default class PostList extends React.Component {
};
}
componentDidMount() {
window.onload = () => this.scrollToBottom();
if (this.props.isActive) {
this.activate();
this.loadFirstPosts(this.props.channelId);

View File

@@ -56,6 +56,7 @@ export default class RhsComment extends React.Component {
}
parseEmojis() {
twemoji.parse(React.findDOMNode(this), {size: Constants.EMOJI_SIZE});
global.window.emojify.run(React.findDOMNode(this.refs.message_holder));
}
componentDidMount() {
this.parseEmojis();
@@ -208,6 +209,7 @@ export default class RhsComment extends React.Component {
<p className={postClass}>
{loading}
<div
ref='message_holder'
onClick={TextFormatting.handleClick}
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(post.message)}}
/>

View File

@@ -20,6 +20,7 @@ export default class RhsRootPost extends React.Component {
}
parseEmojis() {
twemoji.parse(React.findDOMNode(this), {size: Constants.EMOJI_SIZE});
global.window.emojify.run(React.findDOMNode(this.refs.message_holder));
}
componentDidMount() {
this.parseEmojis();
@@ -148,6 +149,7 @@ export default class RhsRootPost extends React.Component {
</ul>
<div className='post-body'>
<div
ref='message_holder'
onClick={TextFormatting.handleClick}
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(post.message)}}
/>