From a7ceba2e57f5b693afa51b0aefd04081646c6948 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Tue, 3 Nov 2015 14:09:09 -0500
Subject: Fixed theme confirmation dialog to work in all cases and removed some
 jquery magic related to it

---
 .../components/user_settings/user_settings.jsx     | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

(limited to 'web/react/components/user_settings/user_settings.jsx')

diff --git a/web/react/components/user_settings/user_settings.jsx b/web/react/components/user_settings/user_settings.jsx
index cebbbebce..e089ce973 100644
--- a/web/react/components/user_settings/user_settings.jsx
+++ b/web/react/components/user_settings/user_settings.jsx
@@ -16,6 +16,7 @@ export default class UserSettings extends React.Component {
     constructor(props) {
         super(props);
 
+        this.getActiveTab = this.getActiveTab.bind(this);
         this.onListenerChange = this.onListenerChange.bind(this);
 
         this.state = {user: UserStore.getCurrentUser()};
@@ -29,6 +30,10 @@ export default class UserSettings extends React.Component {
         UserStore.removeChangeListener(this.onListenerChange);
     }
 
+    getActiveTab() {
+        return this.refs.activeTab;
+    }
+
     onListenerChange() {
         var user = UserStore.getCurrentUser();
         if (!utils.areStatesEqual(this.state.user, user)) {
@@ -41,10 +46,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <GeneralTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -52,10 +60,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <SecurityTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                         setEnforceFocus={this.props.setEnforceFocus}
                     />
                 </div>
@@ -64,10 +75,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <NotificationsTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -75,9 +89,12 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <AppearanceTab
+                        ref='activeTab'
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                         setEnforceFocus={this.props.setEnforceFocus}
                         setRequireConfirm={this.props.setRequireConfirm}
                     />
@@ -87,8 +104,11 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <DeveloperTab
+                        ref='activeTab'
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -96,10 +116,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <IntegrationsTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -107,10 +130,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <DisplayTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -118,10 +144,13 @@ export default class UserSettings extends React.Component {
             return (
                 <div>
                     <AdvancedTab
+                        ref='activeTab'
                         user={this.state.user}
                         activeSection={this.props.activeSection}
                         updateSection={this.props.updateSection}
                         updateTab={this.props.updateTab}
+                        closeModal={this.props.closeModal}
+                        collapseModal={this.props.collapseModal}
                     />
                 </div>
             );
@@ -136,6 +165,8 @@ UserSettings.propTypes = {
     activeSection: React.PropTypes.string,
     updateSection: React.PropTypes.func,
     updateTab: React.PropTypes.func,
+    closeModal: React.PropTypes.func.isRequired,
+    collapseModal: React.PropTypes.func.isRequired,
     setEnforceFocus: React.PropTypes.func.isRequired,
     setRequireConfirm: React.PropTypes.func.isRequired
 };
-- 
cgit v1.2.3-1-g7c22

