mirror of https://github.com/zulip/zulip.git
settings_org: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes and variables to align with Zulip's no-abbreviations policy and streamline the search results.
This commit is contained in:
parent
6e9ad8607e
commit
4105fc4e77
|
@ -715,8 +715,8 @@ function discard_realm_settings_subsection_changes($subsection: JQuery): void {
|
||||||
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
||||||
discard_realm_property_element_changes(elem);
|
discard_realm_property_element_changes(elem);
|
||||||
}
|
}
|
||||||
const $save_btn_controls = $subsection.find(".save-button-controls");
|
const $save_button_controls = $subsection.find(".save-button-controls");
|
||||||
settings_components.change_save_button_state($save_btn_controls, "discarded");
|
settings_components.change_save_button_state($save_button_controls, "discarded");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function discard_stream_settings_subsection_changes(
|
export function discard_stream_settings_subsection_changes(
|
||||||
|
@ -726,8 +726,8 @@ export function discard_stream_settings_subsection_changes(
|
||||||
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
||||||
discard_stream_property_element_changes(elem, sub);
|
discard_stream_property_element_changes(elem, sub);
|
||||||
}
|
}
|
||||||
const $save_btn_controls = $subsection.find(".save-button-controls");
|
const $save_button_controls = $subsection.find(".save-button-controls");
|
||||||
settings_components.change_save_button_state($save_btn_controls, "discarded");
|
settings_components.change_save_button_state($save_button_controls, "discarded");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function discard_group_settings_subsection_changes(
|
export function discard_group_settings_subsection_changes(
|
||||||
|
@ -737,16 +737,16 @@ export function discard_group_settings_subsection_changes(
|
||||||
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
||||||
discard_group_property_element_changes(elem, group);
|
discard_group_property_element_changes(elem, group);
|
||||||
}
|
}
|
||||||
const $save_btn_controls = $subsection.find(".save-button-controls");
|
const $save_button_controls = $subsection.find(".save-button-controls");
|
||||||
settings_components.change_save_button_state($save_btn_controls, "discarded");
|
settings_components.change_save_button_state($save_button_controls, "discarded");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function discard_realm_default_settings_subsection_changes($subsection: JQuery): void {
|
export function discard_realm_default_settings_subsection_changes($subsection: JQuery): void {
|
||||||
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
for (const elem of settings_components.get_subsection_property_elements($subsection)) {
|
||||||
discard_realm_default_property_element_changes(elem);
|
discard_realm_default_property_element_changes(elem);
|
||||||
}
|
}
|
||||||
const $save_btn_controls = $subsection.find(".save-button-controls");
|
const $save_button_controls = $subsection.find(".save-button-controls");
|
||||||
settings_components.change_save_button_state($save_btn_controls, "discarded");
|
settings_components.change_save_button_state($save_button_controls, "discarded");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deactivate_organization(e: JQuery.Event): void {
|
export function deactivate_organization(e: JQuery.Event): void {
|
||||||
|
@ -804,21 +804,21 @@ export function save_organization_settings(
|
||||||
success_continuation: (() => void) | undefined = undefined,
|
success_continuation: (() => void) | undefined = undefined,
|
||||||
): void {
|
): void {
|
||||||
const $subsection_parent = $save_button.closest(".settings-subsection-parent");
|
const $subsection_parent = $save_button.closest(".settings-subsection-parent");
|
||||||
const $save_btn_container = $subsection_parent.find(".save-button-controls");
|
const $save_button_container = $subsection_parent.find(".save-button-controls");
|
||||||
const $failed_alert_elem = $subsection_parent.find(".subsection-failed-status p");
|
const $failed_alert_elem = $subsection_parent.find(".subsection-failed-status p");
|
||||||
settings_components.change_save_button_state($save_btn_container, "saving");
|
settings_components.change_save_button_state($save_button_container, "saving");
|
||||||
channel.patch({
|
channel.patch({
|
||||||
url: patch_url,
|
url: patch_url,
|
||||||
data,
|
data,
|
||||||
success() {
|
success() {
|
||||||
$failed_alert_elem.hide();
|
$failed_alert_elem.hide();
|
||||||
settings_components.change_save_button_state($save_btn_container, "succeeded");
|
settings_components.change_save_button_state($save_button_container, "succeeded");
|
||||||
if (success_continuation !== undefined) {
|
if (success_continuation !== undefined) {
|
||||||
success_continuation();
|
success_continuation();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error(xhr) {
|
error(xhr) {
|
||||||
settings_components.change_save_button_state($save_btn_container, "failed");
|
settings_components.change_save_button_state($save_button_container, "failed");
|
||||||
$save_button.hide();
|
$save_button.hide();
|
||||||
ui_report.error($t_html({defaultMessage: "Save failed"}), xhr, $failed_alert_elem);
|
ui_report.error($t_html({defaultMessage: "Save failed"}), xhr, $failed_alert_elem);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue