summaryrefslogtreecommitdiffstats
path: root/web/react/components/textbox.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-07-24 08:52:20 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-07-24 13:03:58 -0700
commitb27562cedc64090ea030eaea0f540739f47ba6c2 (patch)
treef69ceb068bce010da02372bb9df54bfd7cd65fa2 /web/react/components/textbox.jsx
parent414c2bed91f7fa9a936b2fba36e70558b5ffb997 (diff)
downloadchat-b27562cedc64090ea030eaea0f540739f47ba6c2.tar.gz
chat-b27562cedc64090ea030eaea0f540739f47ba6c2.tar.bz2
chat-b27562cedc64090ea030eaea0f540739f47ba6c2.zip
Removed vestige textdiv code that is also no longer necessary due to removing the mention tags
Diffstat (limited to 'web/react/components/textbox.jsx')
-rw-r--r--web/react/components/textbox.jsx22
1 files changed, 1 insertions, 21 deletions
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index d586b3918..bbd1f84b6 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -36,7 +36,6 @@ module.exports = React.createClass({
this.resize();
this.processMentions();
- this.updateTextdiv();
},
componentWillUnmount: function() {
PostStore.removeAddMentionListener(this._onChange);
@@ -87,7 +86,6 @@ module.exports = React.createClass({
this.processMentions();
this.doProcessMentions = false;
}
- this.updateTextdiv();
this.resize();
},
componentWillReceiveProps: function(nextProps) {
@@ -117,12 +115,6 @@ module.exports = React.createClass({
});
}, 1);
},
- updateTextdiv: function() {
- var html = utils.insertHtmlEntities(this.refs.message.getDOMNode().value);
- var re = new RegExp('(^$)(?![.\n])', 'gm');
- html = html.replace(re, '<br/><br/>');
- $(this.refs.textdiv.getDOMNode()).html(html);
- },
handleChange: function() {
this.props.onUserInput(this.refs.message.getDOMNode().value);
this.resize();
@@ -187,7 +179,6 @@ module.exports = React.createClass({
var matches = text.match(re1);
if (!matches) {
- $(this.refs.textdiv.getDOMNode()).text(text);
this.updateMentionTab(null, []);
return;
}
@@ -280,15 +271,9 @@ module.exports = React.createClass({
elm.value = cmd;
this.handleChange();
},
- scroll: function() {
- var e = this.refs.message.getDOMNode();
- var d = this.refs.textdiv.getDOMNode();
- $(d).scrollTop($(e).scrollTop());
- },
resize: function() {
var e = this.refs.message.getDOMNode();
var w = this.refs.wrapper.getDOMNode();
- var d = this.refs.textdiv.getDOMNode();
var lht = parseInt($(e).css('lineHeight'),10);
var lines = e.scrollHeight / lht;
@@ -296,15 +281,11 @@ module.exports = React.createClass({
if (e.scrollHeight - mod < 167) {
$(e).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod);
- $(d).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod);
$(w).css({'height':'auto'}).height(e.scrollHeight+2);
} else {
$(e).css({'height':'auto','overflow-y':'scroll'}).height(167);
- $(d).css({'height':'auto','overflow-y':'scroll'}).height(167);
$(w).css({'height':'auto'}).height(167);
}
-
- $(d).scrollTop($(e).scrollTop());
},
handleFocus: function() {
var elm = this.refs.message.getDOMNode();
@@ -325,8 +306,7 @@ module.exports = React.createClass({
return (
<div ref="wrapper" className="textarea-wrapper">
<CommandList ref='commands' addCommand={this.addCommand} channelId={this.props.channelId} />
- <div className="form-control textarea-div" ref="textdiv"/>
- <textarea id={this.props.id} ref="message" className={"form-control custom-textarea " + this.state.connection} spellCheck="true" autoComplete="off" autoCorrect="off" rows="1" placeholder={this.props.createMessage} value={this.props.messageText} onInput={this.handleChange} onChange={this.handleChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} onScroll={this.scroll} onFocus={this.handleFocus} onBlur={this.handleBlur} onPaste={this.handlePaste} />
+ <textarea id={this.props.id} ref="message" className={"form-control custom-textarea " + this.state.connection} spellCheck="true" autoComplete="off" autoCorrect="off" rows="1" placeholder={this.props.createMessage} value={this.props.messageText} onInput={this.handleChange} onChange={this.handleChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} onFocus={this.handleFocus} onBlur={this.handleBlur} onPaste={this.handlePaste} />
</div>
);
}