diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-09-14 11:48:07 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-09-14 12:22:02 -0400 |
commit | 15aa853da5f6be8a95970d73a700afc6b626c572 (patch) | |
tree | 76295c2eca6a3218466292127e68626adfdf6a76 /web/react/components/post_body.jsx | |
parent | 3e3b52554a49b8c2d9c242061bfc82be2948b645 (diff) | |
download | chat-15aa853da5f6be8a95970d73a700afc6b626c572.tar.gz chat-15aa853da5f6be8a95970d73a700afc6b626c572.tar.bz2 chat-15aa853da5f6be8a95970d73a700afc6b626c572.zip |
Removed all calls to textToJsx and replaced them with calls to TextFormatting
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r-- | web/react/components/post_body.jsx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index e08936923..df4ed3d57 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -13,7 +13,6 @@ export default class PostBody extends React.Component { super(props); this.parseEmojis = this.parseEmojis.bind(this); - this.handleClick = this.handleClick.bind(this); const linkData = Utils.extractLinks(this.props.post.message); this.state = {links: linkData.links, message: linkData.text}; @@ -31,17 +30,10 @@ export default class PostBody extends React.Component { const linkData = Utils.extractLinks(nextProps.post.message); this.setState({links: linkData.links, message: linkData.text}); } - handleClick(e) { - let mentionAttribute = e.target.getAttributeNode('data-mention'); - if (mentionAttribute) { - Utils.searchForTerm(mentionAttribute.value); - } - } render() { const post = this.props.post; const filenames = this.props.post.filenames; const parentPost = this.props.parentPost; - const inner = Utils.textToJsx(this.state.message); let comment = ''; let postClass = ''; @@ -143,7 +135,11 @@ export default class PostBody extends React.Component { key={`${post.id}_message`} className={postClass} > - {loading}<span onClick={this.handleClick} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}/> + {loading} + <span + onClick={TextFormatting.handleClick} + dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}} + /> </p> {fileAttachmentHolder} {embed} |