summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-12-28 09:25:31 -0500
committerJoramWilander <jwawilander@gmail.com>2015-12-28 09:25:31 -0500
commit13f9a55cfd8cd32272f09998ee7a64537bfc0af8 (patch)
tree51ccceb7bda2cc87648dc8dcbd7dddc73c3873b1 /web
parent2f04ea6dd292e2b11e1fc4149ae1ea759d31bea5 (diff)
downloadchat-13f9a55cfd8cd32272f09998ee7a64537bfc0af8.tar.gz
chat-13f9a55cfd8cd32272f09998ee7a64537bfc0af8.tar.bz2
chat-13f9a55cfd8cd32272f09998ee7a64537bfc0af8.zip
Fix appearance settings scroll bug
Diffstat (limited to 'web')
-rw-r--r--web/react/components/user_settings/user_settings_appearance.jsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/components/user_settings/user_settings_appearance.jsx b/web/react/components/user_settings/user_settings_appearance.jsx
index ad41ab771..7bfc9fdbd 100644
--- a/web/react/components/user_settings/user_settings_appearance.jsx
+++ b/web/react/components/user_settings/user_settings_appearance.jsx
@@ -74,6 +74,10 @@ export default class UserSettingsAppearance extends React.Component {
this.props.setEnforceFocus(true);
}
+ scrollToTop() {
+ $('.ps-container.modal-body').scrollTop(0);
+ $('.ps-container.modal-body').perfectScrollbar('update');
+ }
submitTheme(e) {
e.preventDefault();
var user = UserStore.getCurrentUser();
@@ -88,9 +92,7 @@ export default class UserSettingsAppearance extends React.Component {
this.props.setRequireConfirm(false);
this.originalTheme = Object.assign({}, this.state.theme);
-
- $('.ps-container.modal-body').scrollTop(0);
- $('.ps-container.modal-body').perfectScrollbar('update');
+ this.scrollToTop();
},
(err) => {
var state = this.getStateFromStores();
@@ -129,6 +131,7 @@ export default class UserSettingsAppearance extends React.Component {
const state = this.getStateFromStores();
state.serverError = null;
this.setState(state);
+ this.scrollToTop();
Utils.applyTheme(state.theme);