mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
settings_orgs: Use button element for save-discard button.
There is no clear reason to not use a button element here. According to the spec pharasing content, which includes the <span> element, are allowed in the button element. Manually tested both buttons to make sure it works and made sure all the selectors are updated by grepping all the selector classes/id in the handlebars templates that are parents of the button or are present on the button. (One of the jQuery handler code got reformatted due to it fitting the line limit due to one character deletion for the selector)
This commit is contained in:
committed by
Tim Abbott
parent
cee94654df
commit
2441138a7b
@@ -763,19 +763,15 @@ export function build_page() {
|
||||
return undefined;
|
||||
});
|
||||
|
||||
$(".organization").on(
|
||||
"click",
|
||||
".subsection-header .subsection-changes-discard .button",
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
for (const elem of get_subsection_property_elements(e.target)) {
|
||||
discard_property_element_changes(elem);
|
||||
}
|
||||
const save_btn_controls = $(e.target).closest(".save-button-controls");
|
||||
change_save_button_state(save_btn_controls, "discarded");
|
||||
},
|
||||
);
|
||||
$(".organization").on("click", ".subsection-header .subsection-changes-discard button", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
for (const elem of get_subsection_property_elements(e.target)) {
|
||||
discard_property_element_changes(elem);
|
||||
}
|
||||
const save_btn_controls = $(e.target).closest(".save-button-controls");
|
||||
change_save_button_state(save_btn_controls, "discarded");
|
||||
});
|
||||
|
||||
save_organization_settings = function (data, save_button) {
|
||||
const subsection_parent = save_button.closest(".org-subsection-parent");
|
||||
@@ -992,7 +988,7 @@ export function build_page() {
|
||||
return data;
|
||||
}
|
||||
|
||||
$(".organization").on("click", ".subsection-header .subsection-changes-save .button", (e) => {
|
||||
$(".organization").on("click", ".subsection-header .subsection-changes-save button", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const save_button = $(e.currentTarget);
|
||||
@@ -1013,7 +1009,7 @@ export function build_page() {
|
||||
e.preventDefault();
|
||||
$(e.target)
|
||||
.closest(".org-subsection-parent")
|
||||
.find(".subsection-changes-save .button")
|
||||
.find(".subsection-changes-save button")
|
||||
.trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user