diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-11-18 08:49:29 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-11-18 08:49:29 -0500 |
commit | 7b01528d17c61a762ded17a23ccd9a2a728910a0 (patch) | |
tree | 9dd7fd2667ae03c4e72bb4abd495d2c3d84373ea /web/react/components/user_settings/user_settings_modal.jsx | |
parent | 5716a5e2fd96859e7d0c8784bd0297b4654dcf4b (diff) | |
parent | 70de0125abdc84d70580f82b29a4314e3515a587 (diff) | |
download | chat-7b01528d17c61a762ded17a23ccd9a2a728910a0.tar.gz chat-7b01528d17c61a762ded17a23ccd9a2a728910a0.tar.bz2 chat-7b01528d17c61a762ded17a23ccd9a2a728910a0.zip |
Merge pull request #1423 from hmhealey/plt737
PLT-737 Converted first set of Modals to ReactBootstrap
Diffstat (limited to 'web/react/components/user_settings/user_settings_modal.jsx')
-rw-r--r-- | web/react/components/user_settings/user_settings_modal.jsx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx index 4dcf32cb9..776201295 100644 --- a/web/react/components/user_settings/user_settings_modal.jsx +++ b/web/react/components/user_settings/user_settings_modal.jsx @@ -10,6 +10,7 @@ export default class UserSettingsModal extends React.Component { constructor(props) { super(props); + this.handleShow = this.handleShow.bind(this); this.handleHide = this.handleHide.bind(this); this.handleHidden = this.handleHidden.bind(this); this.handleCollapse = this.handleCollapse.bind(this); @@ -33,12 +34,22 @@ export default class UserSettingsModal extends React.Component { this.requireConfirm = false; } + componentDidMount() { + if (this.props.show) { + this.handleShow(); + } + } + componentDidUpdate(prevProps) { - if (!prevProps.show && this.props.show) { - $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300); - if ($(window).width() > 768) { - $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar(); - } + if (this.props.show && !prevProps.show) { + this.handleShow(); + } + } + + handleShow() { + $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300); + if ($(window).width() > 768) { + $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar(); } } |