From 68ba3174fe5c28a8499e2bb97b286a09ceaa4f7e Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 25 Aug 2015 17:38:16 -0700 Subject: Clears the 'new channel' dialogue box of errors and previous input on exit --- web/react/components/new_channel.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/react') 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: ''}; -- cgit v1.2.3-1-g7c22