mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
settings: Improve enable_or_disable_save_button method code.
This commit reorganizes the code in enable_or_disable_save_button method, and improves its readability. It also replaces the previous tooltip logic for the disabled save button in the save/discard widget with the more standardized methods to handle the same from ui_util.ts.
This commit is contained in:
@@ -22,6 +22,10 @@ mock_esm("../src/buttons", {
|
||||
modify_action_button_style: noop,
|
||||
});
|
||||
mock_esm("../src/scroll_util", {scroll_element_into_container: noop});
|
||||
mock_esm("../src/ui_util", {
|
||||
disable_element_and_add_tooltip: noop,
|
||||
enable_element_and_remove_tooltip: noop,
|
||||
});
|
||||
set_global("document", "document-stub");
|
||||
|
||||
set_global("requestAnimationFrame", (func) => func());
|
||||
@@ -95,6 +99,7 @@ function createSaveButtons(subsection) {
|
||||
$stub_save_button_header.set_find_results(".time-limit-setting", []);
|
||||
$stub_save_button_header.set_find_results(".pill-container", []);
|
||||
$stub_save_button_header.set_find_results(".subsection-changes-save button", $stub_save_button);
|
||||
$stub_save_button_header.set_find_results(".save-button", $stub_save_button);
|
||||
|
||||
return {
|
||||
props,
|
||||
|
||||
Reference in New Issue
Block a user