mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
refactor: Use object destructuring for function parameter.
This make type annotating easier.
This commit is contained in:
committed by
Tim Abbott
parent
fd45ef57fa
commit
2a21f626a7
@@ -117,13 +117,16 @@ export function reset_password_toggle_icons(password_field, password_selector) {
|
|||||||
set_password_toggle_label(password_selector, label, true);
|
set_password_toggle_label(password_selector, label, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setup_password_visibility_toggle(password_field_id, password_selector, opts = {}) {
|
export function setup_password_visibility_toggle(
|
||||||
opts = {tippy_tooltips: false, ...opts};
|
password_field_id,
|
||||||
|
password_selector,
|
||||||
|
{tippy_tooltips = false} = {},
|
||||||
|
) {
|
||||||
const label = $t({defaultMessage: "Show password"});
|
const label = $t({defaultMessage: "Show password"});
|
||||||
set_password_toggle_label(password_selector, label, opts.tippy_tooltips);
|
set_password_toggle_label(password_selector, label, tippy_tooltips);
|
||||||
$(password_selector).on("click", (e) => {
|
$(password_selector).on("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
toggle_password_visibility(password_field_id, password_selector, opts.tippy_tooltips);
|
toggle_password_visibility(password_field_id, password_selector, tippy_tooltips);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user