summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-26 09:28:16 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-26 09:28:16 -0400
commit378f0b52c10d3b9dc670da34a0043b7e05f3e93c (patch)
treecdbaa018b6cb689f8dfe110a050f793f844c770c /web/react
parentd653dc18e47c3548c974722ab3b0f4e7645a5b25 (diff)
parent68ba3174fe5c28a8499e2bb97b286a09ceaa4f7e (diff)
downloadchat-378f0b52c10d3b9dc670da34a0043b7e05f3e93c.tar.gz
chat-378f0b52c10d3b9dc670da34a0043b7e05f3e93c.tar.bz2
chat-378f0b52c10d3b9dc670da34a0043b7e05f3e93c.zip
Merge pull request #478 from rgarmsen2295/mm-2007
MM-2007 Clears the 'New Channel' dialogue box of errors and previous input on exit
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/new_channel.jsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/components/new_channel.jsx b/web/react/components/new_channel.jsx
index 38c9ea76d..fc24a7cdc 100644
--- a/web/react/components/new_channel.jsx
+++ b/web/react/components/new_channel.jsx
@@ -84,6 +84,17 @@ module.exports = React.createClass({
var button = e.relatedTarget;
self.setState({channelType: $(button).attr('data-channeltype')});
});
+ $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose);
+ },
+ handleClose: function() {
+ $(this.getDOMNode()).find('.form-control').each(function clearForms() {
+ this.value = '';
+ });
+
+ this.setState({channelType: '', displayNameError: '', nameError: '', serverError: '', inValid: false});
},
getInitialState: function() {
return {channelType: ''};