mirror of https://github.com/zulip/zulip.git
settings: Rename show_spinner and hide_spinner.
Change show_spinner to show_button_spinner and hide_spinner to hide_button_spinner.
This commit is contained in:
parent
017dd39382
commit
bc27fd2a27
|
@ -92,7 +92,7 @@ export function hide_dialog_spinner(): void {
|
||||||
const $spinner = $(`${dialog_widget_selector} .modal__spinner`);
|
const $spinner = $(`${dialog_widget_selector} .modal__spinner`);
|
||||||
$(`${dialog_widget_selector} .modal__button`).prop("disabled", false);
|
$(`${dialog_widget_selector} .modal__button`).prop("disabled", false);
|
||||||
|
|
||||||
loading.hide_spinner($(".dialog_submit_button"), $spinner);
|
loading.hide_button_spinner($(".dialog_submit_button"), $spinner);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function show_dialog_spinner(): void {
|
export function show_dialog_spinner(): void {
|
||||||
|
@ -102,7 +102,7 @@ export function show_dialog_spinner(): void {
|
||||||
|
|
||||||
const $spinner = $(`${dialog_widget_selector} .modal__spinner`);
|
const $spinner = $(`${dialog_widget_selector} .modal__spinner`);
|
||||||
|
|
||||||
loading.show_spinner($(".dialog_submit_button"), $spinner);
|
loading.show_button_spinner($(".dialog_submit_button"), $spinner);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Supports a callback to be called once the modal finishes closing.
|
// Supports a callback to be called once the modal finishes closing.
|
||||||
|
|
|
@ -81,7 +81,7 @@ export function destroy_indicator($container: JQuery): void {
|
||||||
$container.css({width: 0, height: 0});
|
$container.css({width: 0, height: 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function show_spinner($button_element: JQuery, $spinner: JQuery): void {
|
export function show_button_spinner($button_element: JQuery, $spinner: JQuery): void {
|
||||||
const span_width = $button_element.find(".submit-button-text").width();
|
const span_width = $button_element.find(".submit-button-text").width();
|
||||||
const span_height = $button_element.find(".submit-button-text").height();
|
const span_height = $button_element.find(".submit-button-text").height();
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ export function show_spinner($button_element: JQuery, $spinner: JQuery): void {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hide_spinner($button_element: JQuery, $spinner: JQuery): void {
|
export function hide_button_spinner($button_element: JQuery, $spinner: JQuery): void {
|
||||||
// Show the span
|
// Show the span
|
||||||
$button_element.find(".submit-button-text").show();
|
$button_element.find(".submit-button-text").show();
|
||||||
|
|
||||||
|
|
|
@ -345,7 +345,7 @@ export function hide_message_edit_spinner($row: JQuery): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function show_message_edit_spinner($row: JQuery): void {
|
export function show_message_edit_spinner($row: JQuery): void {
|
||||||
loading.show_spinner($row, $row.find(".modal__spinner"));
|
loading.show_button_spinner($row, $row.find(".modal__spinner"));
|
||||||
$row.find(".message_edit_save span").hide();
|
$row.find(".message_edit_save span").hide();
|
||||||
$row.find(".message_edit_save").addClass("message-edit-button-disabled");
|
$row.find(".message_edit_save").addClass("message-edit-button-disabled");
|
||||||
$row.find(".message_edit_cancel").addClass("message-edit-button-disabled");
|
$row.find(".message_edit_cancel").addClass("message-edit-button-disabled");
|
||||||
|
|
|
@ -89,13 +89,13 @@ const EMBEDDED_BOT_TYPE = "4";
|
||||||
export function show_button_spinner($button: JQuery): void {
|
export function show_button_spinner($button: JQuery): void {
|
||||||
const $spinner = $button.find(".modal__spinner");
|
const $spinner = $button.find(".modal__spinner");
|
||||||
$button.prop("disabled", true);
|
$button.prop("disabled", true);
|
||||||
loading.show_spinner($button, $spinner);
|
loading.show_button_spinner($button, $spinner);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hide_button_spinner($button: JQuery): void {
|
export function hide_button_spinner($button: JQuery): void {
|
||||||
const $spinner = $button.find(".modal__spinner");
|
const $spinner = $button.find(".modal__spinner");
|
||||||
$button.prop("disabled", false);
|
$button.prop("disabled", false);
|
||||||
loading.hide_spinner($button, $spinner);
|
loading.hide_button_spinner($button, $spinner);
|
||||||
}
|
}
|
||||||
|
|
||||||
function compare_by_name(
|
function compare_by_name(
|
||||||
|
|
|
@ -401,8 +401,11 @@ test_ui("enter_with_preview_open", ({override, override_rewire}) => {
|
||||||
override_rewire(compose_banner, "clear_message_sent_banners", noop);
|
override_rewire(compose_banner, "clear_message_sent_banners", noop);
|
||||||
override(document, "to_$", () => $("document-stub"));
|
override(document, "to_$", () => $("document-stub"));
|
||||||
let show_button_spinner_called = false;
|
let show_button_spinner_called = false;
|
||||||
override(loading, "show_button_spinner", ($spinner) => {
|
override(loading, "show_button_spinner", ($button_element, $spinner) => {
|
||||||
assert.equal($spinner.selector, ".compose-submit-button .loader");
|
// Check that the correct button and spinner elements are passed
|
||||||
|
assert.equal($button_element.selector, ".compose-submit-button");
|
||||||
|
assert.equal($spinner.selector, ".compose-submit-button .modal__spinner");
|
||||||
|
|
||||||
show_button_spinner_called = true;
|
show_button_spinner_called = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -449,8 +452,11 @@ test_ui("finish", ({override, override_rewire}) => {
|
||||||
override_rewire(compose_banner, "clear_message_sent_banners", noop);
|
override_rewire(compose_banner, "clear_message_sent_banners", noop);
|
||||||
override(document, "to_$", () => $("document-stub"));
|
override(document, "to_$", () => $("document-stub"));
|
||||||
let show_button_spinner_called = false;
|
let show_button_spinner_called = false;
|
||||||
override(loading, "show_button_spinner", ($spinner) => {
|
override(loading, "show_button_spinner", ($button_element, $spinner) => {
|
||||||
assert.equal($spinner.selector, ".compose-submit-button .loader");
|
// Check that the correct button and spinner elements are passed
|
||||||
|
assert.equal($button_element.selector, ".compose-submit-button");
|
||||||
|
assert.equal($spinner.selector, ".compose-submit-button .modal__spinner");
|
||||||
|
|
||||||
show_button_spinner_called = true;
|
show_button_spinner_called = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue