From c5ee567bacbc55372d526c668fa138c80545498e Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Thu, 13 Aug 2015 08:50:40 -0700
Subject: Refactored such that the menu doesn't open for firefox users

---
 web/react/components/user_settings.jsx | 45 +++++++++++++---------------------
 1 file changed, 17 insertions(+), 28 deletions(-)

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

diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index fa01d62c2..0dfea6543 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -236,36 +236,24 @@ var NotificationsTab = React.createClass({
         }
 
         var soundSection;
-        if (this.props.activeSection === 'sound') {
-            var inputs = [];
+        if (this.props.activeSection === 'sound' && this.state.soundNeeded) {
+            var soundActive = ["",""];
+            if (this.state.enable_sound === "false") {
+                soundActive[1] = "active";
+            } else {
+                soundActive[0] = "active";
+            }
 
-            if(this.state.soundNeeded) {
-                var soundActive = ["",""];
-                if (this.state.enable_sound === "false") {
-                    soundActive[1] = "active";
-                } else {
-                    soundActive[0] = "active";
-                }
+            var inputs = [];
 
-                inputs.push(
-                    <div>
-                        <div className="btn-group" data-toggle="buttons-radio">
-                            <button className={"btn btn-default "+soundActive[0]} onClick={function(){self.handleSoundRadio("true")}}>On</button>
-                            <button className={"btn btn-default "+soundActive[1]} onClick={function(){self.handleSoundRadio("false")}}>Off</button>
-                        </div>
-                    </div>
-                );
-            } else {
-                inputs.push(
-                    <div>
-                        <div className='btn-group' data-toggle='buttons-radio'>
-                            <button className='btn btn-default' disabled>On</button>
-                            <button className='btn btn-default' disabled>Off</button>
-                        </div>
-                        <div><br/>Please disable notification sounds in your browser settings</div>
+            inputs.push(
+                <div>
+                    <div className="btn-group" data-toggle="buttons-radio">
+                        <button className={"btn btn-default "+soundActive[0]} onClick={function(){self.handleSoundRadio("true")}}>On</button>
+                        <button className={"btn btn-default "+soundActive[1]} onClick={function(){self.handleSoundRadio("false")}}>Off</button>
                     </div>
-                )
-            }
+                </div>
+            );
 
             soundSection = (
                 <SettingItemMax
@@ -279,7 +267,7 @@ var NotificationsTab = React.createClass({
         } else {
             var describe = "";
             if (!this.state.soundNeeded) {
-                describe = "See Inside"
+                describe = "Please configure notification sounds in your browser settings"
             } else if (this.state.enable_sound === "false") {
                 describe = "Off";
             } else {
@@ -291,6 +279,7 @@ var NotificationsTab = React.createClass({
                     title="Desktop notification sounds"
                     describe={describe}
                     updateSection={function(){self.props.updateSection("sound");}}
+                    disableOpen = {!this.state.soundNeeded}
                 />
             );
         }
-- 
cgit v1.2.3-1-g7c22

