summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/react/components/setting_item_min.jsx6
-rw-r--r--web/react/components/user_settings.jsx45
-rw-r--r--web/react/utils/utils.jsx2
3 files changed, 23 insertions, 30 deletions
diff --git a/web/react/components/setting_item_min.jsx b/web/react/components/setting_item_min.jsx
index 2209c74d1..135226900 100644
--- a/web/react/components/setting_item_min.jsx
+++ b/web/react/components/setting_item_min.jsx
@@ -3,10 +3,14 @@
module.exports = React.createClass({
render: function() {
+ var editButton = '';
+ if(!this.props.disableOpen) {
+ editButton = <li className="col-sm-2 section-edit"><a className="section-edit theme" href="#" onClick={this.props.updateSection}>Edit</a></li>;
+ }
return (
<ul className="section-min">
<li className="col-sm-10 section-title">{this.props.title}</li>
- <li className="col-sm-2 section-edit"><a className="section-edit theme" href="#" onClick={this.props.updateSection}>Edit</a></li>
+ {editButton}
<li className="col-sm-7 section-describe">{this.props.describe}</li>
</ul>
);
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}
/>
);
}
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index b1832f3f1..6236e11dd 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -124,7 +124,7 @@ module.exports.notifyMe = function(title, body, channel) {
}
module.exports.ding = function() {
- if (!navigator || navigator.userAgent.toLowerCase().indexOf("firefox") === -1) {
+ if (!navigator || !navigator.userAgent || navigator.userAgent.toLowerCase().indexOf("firefox") === -1) {
var audio = new Audio('/static/images/ding.mp3');
audio.play();
}