mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
settings: Add functions to discard complete subsection.
This commit adds new functions which will be used to discard changes for all the settings in a subsection when clicking on discard button. This change will help in avoiding code duplication when they will be used to discard changes in a subsection if some other user changed a setting in the same subsection.
This commit is contained in:
@@ -916,11 +916,7 @@ export function initialize() {
|
||||
const group = user_groups.get_user_group_from_id(group_id);
|
||||
|
||||
const $subsection = $(e.target).closest(".settings-subsection-parent");
|
||||
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
||||
settings_org.discard_group_property_element_changes(elem, group);
|
||||
}
|
||||
const $save_btn_controls = $(e.target).closest(".save-button-controls");
|
||||
settings_components.change_save_button_state($save_btn_controls, "discarded");
|
||||
settings_org.discard_group_settings_subsection_changes($subsection, group);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user