poll_modal: Fix implicit use of any.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-04 15:07:10 -07:00 committed by Tim Abbott
parent b054050ee8
commit 897dffa598
1 changed files with 5 additions and 5 deletions

View File

@ -9,20 +9,20 @@ function create_option_row($last_option_row_input: JQuery): void {
$row_container.append($(row_html)); $row_container.append($(row_html));
} }
function add_option_row(e: JQuery.TriggeredEvent): void { function add_option_row(this: HTMLElement): void {
// if the option triggering the input event e is not the last, // if the option triggering the input event e is not the last,
// that is, its next sibling has the class `option-row`, we // that is, its next sibling has the class `option-row`, we
// do not add a new option row and return from this function // do not add a new option row and return from this function
// This handles a case when the next empty input row is already // This handles a case when the next empty input row is already
// added and user is updating the above row(s). // added and user is updating the above row(s).
if ($(e.target).closest(".option-row").next().hasClass("option-row")) { if ($(this).closest(".option-row").next().hasClass("option-row")) {
return; return;
} }
create_option_row($(e.target)); create_option_row($(this));
} }
function delete_option_row(e: JQuery.ClickEvent): void { function delete_option_row(this: HTMLElement): void {
const $row = $(e.target).closest(".option-row"); const $row = $(this).closest(".option-row");
$row.remove(); $row.remove();
} }