Skip to content

Commit

Permalink
PLT-1990 Closed markdown preview when edit post modal is closed (#5921)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey authored and jwilander committed Mar 30, 2017
1 parent 364543c commit 4092836
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webapp/components/edit_post_modal.jsx
Expand Up @@ -184,6 +184,8 @@ export default class EditPostModal extends React.Component {
}

onModalHide() {
this.refs.editbox.hidePreview();

if (this.state.refocusId !== '') {
setTimeout(() => {
const element = $(this.state.refocusId).get(0);
Expand Down
4 changes: 4 additions & 0 deletions webapp/components/textbox.jsx
Expand Up @@ -157,6 +157,10 @@ export default class Textbox extends React.Component {
this.setState({preview: !this.state.preview});
}

hidePreview() {
this.setState({preview: false});
}

componentWillReceiveProps(nextProps) {
if (nextProps.channelId !== this.props.channelId) {
// Update channel id for AtMentionProvider.
Expand Down

0 comments on commit 4092836

Please sign in to comment.