summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/channel_view.jsx5
-rw-r--r--webapp/components/permalink_view.jsx5
-rw-r--r--webapp/components/posts_view.jsx2
-rw-r--r--webapp/components/tutorial/tutorial_intro_screens.jsx7
-rw-r--r--webapp/components/tutorial/tutorial_view.jsx5
5 files changed, 15 insertions, 9 deletions
diff --git a/webapp/components/channel_view.jsx b/webapp/components/channel_view.jsx
index 00e1b7f35..45d0f2393 100644
--- a/webapp/components/channel_view.jsx
+++ b/webapp/components/channel_view.jsx
@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import $ from 'jquery';
import React from 'react';
import ChannelHeader from 'components/channel_header.jsx';
@@ -35,9 +36,13 @@ export default class ChannelView extends React.Component {
}
componentDidMount() {
ChannelStore.addChangeListener(this.updateState);
+
+ $('body').addClass('app__body');
}
componentWillUnmount() {
ChannelStore.removeChangeListener(this.updateState);
+
+ $('body').removeClass('app__body');
}
componentWillReceiveProps(nextProps) {
this.setState(this.getStateFromStores(nextProps));
diff --git a/webapp/components/permalink_view.jsx b/webapp/components/permalink_view.jsx
index 2c32d643d..07f826d57 100644
--- a/webapp/components/permalink_view.jsx
+++ b/webapp/components/permalink_view.jsx
@@ -1,6 +1,7 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import $ from 'jquery';
import React from 'react';
import ChannelHeader from 'components/channel_header.jsx';
@@ -45,10 +46,14 @@ export default class PermalinkView extends React.Component {
componentDidMount() {
ChannelStore.addChangeListener(this.updateState);
TeamStore.addChangeListener(this.updateState);
+
+ $('body').addClass('app__body');
}
componentWillUnmount() {
ChannelStore.removeChangeListener(this.updateState);
TeamStore.removeChangeListener(this.updateState);
+
+ $('body').removeClass('app__body');
}
componentWillReceiveProps(nextProps) {
this.setState(this.getStateFromStores(nextProps));
diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx
index 560a46e9a..be098086f 100644
--- a/webapp/components/posts_view.jsx
+++ b/webapp/components/posts_view.jsx
@@ -379,13 +379,11 @@ export default class PostsView extends React.Component {
}
window.addEventListener('resize', this.handleResize);
PreferenceStore.addChangeListener(this.updateState);
- $('body').addClass('app__body');
}
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
this.scrollStopAction.cancel();
PreferenceStore.removeChangeListener(this.updateState);
- $('body').removeClass('app__body');
}
componentDidUpdate() {
if (this.props.postList != null) {
diff --git a/webapp/components/tutorial/tutorial_intro_screens.jsx b/webapp/components/tutorial/tutorial_intro_screens.jsx
index 8b73775e5..0358a6a65 100644
--- a/webapp/components/tutorial/tutorial_intro_screens.jsx
+++ b/webapp/components/tutorial/tutorial_intro_screens.jsx
@@ -1,7 +1,6 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import $ from 'jquery';
import UserStore from 'stores/user_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
@@ -35,12 +34,6 @@ export default class TutorialIntroScreens extends React.Component {
this.state = {currentScreen: 0};
}
- componentDidMount() {
- $('body').addClass('app__body');
- }
- componentWillUnmount() {
- $('body').removeClass('app__body');
- }
handleNext() {
if (this.state.currentScreen < 2) {
this.setState({currentScreen: this.state.currentScreen + 1});
diff --git a/webapp/components/tutorial/tutorial_view.jsx b/webapp/components/tutorial/tutorial_view.jsx
index 5f2c1a257..39e7b6816 100644
--- a/webapp/components/tutorial/tutorial_view.jsx
+++ b/webapp/components/tutorial/tutorial_view.jsx
@@ -6,6 +6,7 @@ import TutorialIntroScreens from './tutorial_intro_screens.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import Constants from 'utils/constants.jsx';
+import $ from 'jquery';
import React from 'react';
export default class TutorialView extends React.Component {
@@ -20,9 +21,13 @@ export default class TutorialView extends React.Component {
}
componentDidMount() {
ChannelStore.addChangeListener(this.handleChannelChange);
+
+ $('body').addClass('app__body');
}
componentWillUnmount() {
ChannelStore.removeChangeListener(this.handleChannelChange);
+
+ $('body').removeClass('app__body');
}
handleChannelChange() {
this.setState({