summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings/user_settings_modal.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-11-10 10:20:16 -0500
committerhmhealey <harrisonmhealey@gmail.com>2015-11-17 11:04:31 -0500
commit0b52e85ba73e5b3badeb1703462c5d05d3a7d224 (patch)
tree0f224748c20bae18af12c3abd76a29ca6a1c1bc4 /web/react/components/user_settings/user_settings_modal.jsx
parent1d7c44919237f424cfd65157cc08bff42753fd0f (diff)
downloadchat-0b52e85ba73e5b3badeb1703462c5d05d3a7d224.tar.gz
chat-0b52e85ba73e5b3badeb1703462c5d05d3a7d224.tar.bz2
chat-0b52e85ba73e5b3badeb1703462c5d05d3a7d224.zip
Added Modal base class that extends ReactBootstrap.Modal
Diffstat (limited to 'web/react/components/user_settings/user_settings_modal.jsx')
-rw-r--r--web/react/components/user_settings/user_settings_modal.jsx14
1 files changed, 7 insertions, 7 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..85a8d0473 100644
--- a/web/react/components/user_settings/user_settings_modal.jsx
+++ b/web/react/components/user_settings/user_settings_modal.jsx
@@ -2,7 +2,7 @@
// See License.txt for license information.
const ConfirmModal = require('../confirm_modal.jsx');
-const Modal = ReactBootstrap.Modal;
+const Modal = require('../modal.jsx');
const SettingsSidebar = require('../settings_sidebar.jsx');
const UserSettings = require('./user_settings.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,10 @@ export default class UserSettingsModal extends React.Component {
this.requireConfirm = false;
}
- 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();
- }
+ handleShow() {
+ $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300);
+ if ($(window).width() > 768) {
+ $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar();
}
}
@@ -176,6 +175,7 @@ export default class UserSettingsModal extends React.Component {
<Modal
dialogClassName='settings-modal'
show={this.props.show}
+ onShow={this.handleShow}
onHide={this.handleHide}
onExited={this.handleHidden}
enforceFocus={this.state.enforceFocus}