Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

spoilers: Fix implicit use of any.

Anders Kaseorgba7fd860b1d6
diff --git a/web/src/spoilers.ts b/web/src/spoilers.ts
index bb6a4b7adab..94cb21c6250 100644
--- a/web/src/spoilers.ts
+++ b/web/src/spoilers.ts
@@ -21,7 +21,7 @@ function expand_spoiler($spoiler: JQuery): void {
// of the content). CSS animations do not work with properties set to
// `auto`, so we get the actual height of the content here and temporarily
// put it explicitly on the element styling to allow the transition to work.
- const spoiler_height: number = $spoiler.prop("scrollHeight");
+ const spoiler_height = $spoiler[0].scrollHeight;
$spoiler.height(`${spoiler_height}px`);
// The `spoiler-content-open` class has CSS animations defined on it which
// will trigger on the frame after this class change.
@@ -49,7 +49,7 @@ export const hide_spoilers_in_notification = ($content: JQuery): JQuery => {
};
export function initialize(): void {
- $("body").on("click", ".spoiler-header", function (e) {
+ $("body").on("click", ".spoiler-header", function (this: HTMLElement, e) {
const $button = $(this).children(".spoiler-button");
const $arrow = $button.children(".spoiler-arrow");
const $spoiler_content = $(this).siblings(".spoiler-content");