From e5a3e557376363042bbaf9923fca0d57fb6b8b3a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Thu, 18 Aug 2016 19:09:33 +0500 Subject: PLT-3842 - Fixing scrolling issue on account/team settings modal (#3819) --- webapp/components/channel_notifications_modal.jsx | 4 +++- webapp/components/team_general_tab.jsx | 4 +++- webapp/components/team_settings_modal.jsx | 4 +++- webapp/components/user_settings/user_settings_advanced.jsx | 4 +++- webapp/components/user_settings/user_settings_display.jsx | 4 +++- webapp/components/user_settings/user_settings_general.jsx | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) (limited to 'webapp') diff --git a/webapp/components/channel_notifications_modal.jsx b/webapp/components/channel_notifications_modal.jsx index f18cefa23..35a2e4087 100644 --- a/webapp/components/channel_notifications_modal.jsx +++ b/webapp/components/channel_notifications_modal.jsx @@ -34,7 +34,9 @@ export default class ChannelNotificationsModal extends React.Component { }; } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } this.setState({activeSection: section}); } componentWillReceiveProps(nextProps) { diff --git a/webapp/components/team_general_tab.jsx b/webapp/components/team_general_tab.jsx index 7ca8f8fce..4d1860de3 100644 --- a/webapp/components/team_general_tab.jsx +++ b/webapp/components/team_general_tab.jsx @@ -81,7 +81,9 @@ class GeneralTab extends React.Component { } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } this.setState(this.setupInitialState(this.props)); this.props.updateSection(section); } diff --git a/webapp/components/team_settings_modal.jsx b/webapp/components/team_settings_modal.jsx index aa7b0831e..bbe426d2e 100644 --- a/webapp/components/team_settings_modal.jsx +++ b/webapp/components/team_settings_modal.jsx @@ -58,7 +58,9 @@ class TeamSettingsModal extends React.Component { } } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } this.setState({activeSection: section}); } render() { diff --git a/webapp/components/user_settings/user_settings_advanced.jsx b/webapp/components/user_settings/user_settings_advanced.jsx index 7d4d0ebc2..c647dd0fd 100644 --- a/webapp/components/user_settings/user_settings_advanced.jsx +++ b/webapp/components/user_settings/user_settings_advanced.jsx @@ -126,7 +126,9 @@ export default class AdvancedSettingsDisplay extends React.Component { } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } if (!section) { this.setState(this.getStateFromStores()); } diff --git a/webapp/components/user_settings/user_settings_display.jsx b/webapp/components/user_settings/user_settings_display.jsx index ee360d736..9ffc4f721 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -126,7 +126,9 @@ export default class UserSettingsDisplay extends React.Component { } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } this.updateState(); this.props.updateSection(section); } diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index e725060ab..814773344 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -285,7 +285,9 @@ class UserSettingsGeneralTab extends React.Component { } updateSection(section) { - $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + if ($('.section-max').length) { + $('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update'); + } const emailChangeInProgress = this.state.emailChangeInProgress; this.setState(Object.assign({}, this.setupInitialState(this.props), {emailChangeInProgress, clientError: '', serverError: '', emailError: ''})); this.submitActive = false; -- cgit v1.2.3-1-g7c22