diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-03 15:15:56 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-03 15:15:56 -0500 |
commit | a413c8ffa684b72840f116380c04a61f1d9cf524 (patch) | |
tree | 287e855db2906058928f1916cbd3fa84857fdcc3 /web/react/components/team_members_modal.jsx | |
parent | bc2768fd254e82b6ca39a916436ab4747898578e (diff) | |
parent | 449f1000e999c409f754724cb998f0b9f90cdd59 (diff) | |
download | chat-a413c8ffa684b72840f116380c04a61f1d9cf524.tar.gz chat-a413c8ffa684b72840f116380c04a61f1d9cf524.tar.bz2 chat-a413c8ffa684b72840f116380c04a61f1d9cf524.zip |
Merge pull request #2318 from hmhealey/plt1090
PLT-1090 Refactored modals that display users
Diffstat (limited to 'web/react/components/team_members_modal.jsx')
-rw-r--r-- | web/react/components/team_members_modal.jsx | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/web/react/components/team_members_modal.jsx b/web/react/components/team_members_modal.jsx index 8ac435742..9bdb16438 100644 --- a/web/react/components/team_members_modal.jsx +++ b/web/react/components/team_members_modal.jsx @@ -3,45 +3,24 @@ import MemberListTeam from './member_list_team.jsx'; import TeamStore from '../stores/team_store.jsx'; +import * as Utils from '../utils/utils.jsx'; import {FormattedMessage} from 'mm-intl'; const Modal = ReactBootstrap.Modal; export default class TeamMembersModal extends React.Component { - constructor(props) { - super(props); - - this.onShow = this.onShow.bind(this); - } - - componentDidMount() { - if (this.props.show) { - this.onShow(); - } - } - - componentDidUpdate(prevProps) { - if (this.props.show && !prevProps.show) { - this.onShow(); - } - } - - onShow() { - if ($(window).width() > 768) { - $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar(); - $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 200); - } else { - $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 150); - } - } - render() { const team = TeamStore.getCurrent(); + let maxHeight = 1000; + if (Utils.windowHeight() <= 1200) { + maxHeight = Utils.windowHeight() - 300; + } + return ( <Modal - dialogClassName='team-members-modal' + dialogClassName='more-modal' show={this.props.show} onHide={this.props.onHide} > @@ -54,10 +33,8 @@ export default class TeamMembersModal extends React.Component { }} /> </Modal.Header> - <Modal.Body ref='modalBody'> - <div className='team-member-list'> - <MemberListTeam/> - </div> + <Modal.Body> + <MemberListTeam style={{maxHeight}}/> </Modal.Body> <Modal.Footer> <button |