confirm_dialog: Rename html_yes_button to html_submit_button.

This commit renames the html_yes_button parameter of confirm
dialog widget to html_submit_button and also all the related
variables in confirm_dialog.js.
This will help in keeping a general name when deduplicating
the code for confirm_dialog and edit_fields_modal.
This commit is contained in:
sahil839
2021-07-05 18:41:23 +05:30
committed by Tim Abbott
parent eaf69bbf16
commit 055d7113f2
15 changed files with 23 additions and 23 deletions

View File

@@ -62,7 +62,7 @@ export function launch(conf) {
// templates.
"html_heading",
"html_body",
"html_yes_button",
"html_submit_button",
"on_click",
"parent",
];
@@ -89,13 +89,13 @@ export function launch(conf) {
);
confirm_dialog.find(".confirm_dialog_body").append(conf.html_body);
const yes_button_span = confirm_dialog.find(".confirm_dialog_yes_button span");
const submit_button_span = confirm_dialog.find(".confirm_dialog_yes_button span");
yes_button_span.html(conf.html_yes_button);
submit_button_span.html(conf.html_submit_button);
const yes_button = confirm_dialog.find(".confirm_dialog_yes_button");
const submit_button = confirm_dialog.find(".confirm_dialog_yes_button");
// Set up handlers.
yes_button.on("click", () => {
submit_button.on("click", () => {
if (conf.loading_spinner) {
show_confirm_dialog_spinner();
} else {
@@ -112,6 +112,6 @@ export function launch(conf) {
overlays.open_modal("#confirm_dialog_modal");
conf.parent.on("shown.bs.modal", () => {
yes_button.trigger("focus");
submit_button.trigger("focus");
});
}