settings: Nest PM content setting in Desktop notification setting.

Fixes #5879
This commit is contained in:
Cynthia Lin 2017-07-20 16:04:12 -07:00 committed by Tim Abbott
parent 0e25055c1d
commit e21c3e1cb7
2 changed files with 13 additions and 2 deletions

View File

@ -74,6 +74,16 @@ exports.set_up = function () {
}
});
});
$("#enable_desktop_notifications").change(function () {
if (this.checked) {
$("#pm_content_in_desktop_notifications").removeAttr("disabled");
$("#pm_content_in_desktop_notifications_label").parent().removeClass("control-label-disabled");
} else {
$("#pm_content_in_desktop_notifications").attr("disabled", true);
$("#pm_content_in_desktop_notifications_label").parent().addClass("control-label-disabled");
}
});
};
function _update_page() {

View File

@ -60,16 +60,17 @@
</label>
</div>
<div class="input-group">
<div class="input-group disableable {{#unless page_params.enable_desktop_notifications}}control-label-disabled{{/unless}}">
<label class="checkbox">
<input type="checkbox" name="pm_content_in_desktop_notifications"
id="pm_content_in_desktop_notifications"
{{#unless page_params.enable_desktop_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.pm_content_in_desktop_notifications}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="pm_content_in_desktop_notifications" class="inline-block">
<label for="pm_content_in_desktop_notifications" id="pm_content_in_desktop_notifications_label" class="inline-block">
{{t "Include content of private messages in desktop notifications" }}
</label>
</div>