diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-07-06 04:21:04 +0800 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-07-05 16:21:04 -0400 |
commit | 81a893b556bbd4e5a73dd41b3dad92915cb06119 (patch) | |
tree | f455a019b374d619be4d88e4ddb1398d9864689d /webapp/components/channel_view.jsx | |
parent | 4efb0f37b701aa8e875e541cc4f121c264e4d8ab (diff) | |
download | chat-81a893b556bbd4e5a73dd41b3dad92915cb06119.tar.gz chat-81a893b556bbd4e5a73dd41b3dad92915cb06119.tar.bz2 chat-81a893b556bbd4e5a73dd41b3dad92915cb06119.zip |
fix position of emoji picker (#6837)
Diffstat (limited to 'webapp/components/channel_view.jsx')
-rw-r--r-- | webapp/components/channel_view.jsx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webapp/components/channel_view.jsx b/webapp/components/channel_view.jsx index 6c2157ffd..4a5ac8969 100644 --- a/webapp/components/channel_view.jsx +++ b/webapp/components/channel_view.jsx @@ -31,18 +31,22 @@ export default class ChannelView extends React.Component { this.state = this.getStateFromStores(props); } + getStateFromStores() { return { channelId: ChannelStore.getCurrentId(), tutorialStep: PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999) }; } + isStateValid() { return this.state.channelId !== ''; } + updateState() { this.setState(this.getStateFromStores(this.props)); } + componentDidMount() { ChannelStore.addChangeListener(this.updateState); @@ -53,14 +57,17 @@ export default class ChannelView extends React.Component { $('body').addClass('browser--ie'); } } + componentWillUnmount() { ChannelStore.removeChangeListener(this.updateState); $('body').removeClass('app__body'); } + componentWillReceiveProps(nextProps) { this.setState(this.getStateFromStores(nextProps)); } + shouldComponentUpdate(nextProps, nextState) { if (!Utils.areObjectsEqual(nextProps.params, this.props.params)) { return true; @@ -72,6 +79,11 @@ export default class ChannelView extends React.Component { return false; } + + getChannelView = () => { + return this.refs.channelView; + } + render() { if (this.state.tutorialStep <= TutorialSteps.INTRO_SCREENS) { return (<TutorialView/>); @@ -79,6 +91,7 @@ export default class ChannelView extends React.Component { return ( <div + ref='channelView' id='app-content' className='app__content' > @@ -93,7 +106,7 @@ export default class ChannelView extends React.Component { className='post-create__container' id='post-create' > - <CreatePost/> + <CreatePost getChannelView={this.getChannelView}/> </div> </div> ); |