org settings: Remove redundant case in update_dependent_subsettings.

This is because we cover the case of `realm_allow_message_editing` by
`realm_msg_edit_limit_setting` after the conversion into dropdown.

This commit also contains a minor variable renaming.
This commit is contained in:
Shubham Dhama 2018-04-27 12:59:20 +05:30 committed by Tim Abbott
parent a3fc7d1371
commit fdc4de9435
1 changed files with 2 additions and 5 deletions

View File

@ -375,9 +375,6 @@ exports.populate_signup_notifications_stream_dropdown = function (stream_list) {
function update_dependent_subsettings(property_name) { function update_dependent_subsettings(property_name) {
if (property_name === 'realm_create_stream_permission' || property_name === 'realm_waiting_period_threshold') { if (property_name === 'realm_create_stream_permission' || property_name === 'realm_waiting_period_threshold') {
set_create_stream_permission_dropdown(); set_create_stream_permission_dropdown();
} else if (property_name === 'realm_allow_message_editing') {
settings_ui.disable_sub_setting_onchange(page_params.realm_allow_message_editing,
"id_realm_message_content_edit_limit_minutes", true);
} else if (property_name === 'realm_invite_required') { } else if (property_name === 'realm_invite_required') {
settings_ui.disable_sub_setting_onchange(page_params.realm_invite_required, settings_ui.disable_sub_setting_onchange(page_params.realm_invite_required,
"id_realm_invite_by_admins_only", true); "id_realm_invite_by_admins_only", true);
@ -702,9 +699,9 @@ function _set_up() {
}); });
$("#id_realm_msg_edit_limit_setting").change(function (e) { $("#id_realm_msg_edit_limit_setting").change(function (e) {
var create_stream_permission = e.target.value; var msg_edit_limit_dropdown_value = e.target.value;
var node = $("#id_realm_message_content_edit_limit_minutes").parent(); var node = $("#id_realm_message_content_edit_limit_minutes").parent();
if (create_stream_permission === 'custom_limit') { if (msg_edit_limit_dropdown_value === 'custom_limit') {
node.show(); node.show();
} else { } else {
node.hide(); node.hide();