js: Prefix jQuery object variable names with $.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-01-25 02:36:19 -08:00
parent f21842e920
commit f84a2c08d5
195 changed files with 4883 additions and 4835 deletions

View File

@@ -6,26 +6,26 @@ export function update_padding(opts: {
total_rows: number;
shown_rows: number;
}): void {
const content = $(opts.content_sel);
const padding = $(opts.padding_sel);
const $content = $(opts.content_sel);
const $padding = $(opts.padding_sel);
const total_rows = opts.total_rows;
const shown_rows = opts.shown_rows;
const hidden_rows = total_rows - shown_rows;
if (shown_rows === 0) {
padding.height(0);
$padding.height(0);
return;
}
const ratio = hidden_rows / shown_rows;
const content_height = content.height();
const content_height = $content.height();
if (content_height === undefined) {
return;
}
const new_padding_height = ratio * content_height;
padding.height(new_padding_height);
padding.width(1);
$padding.height(new_padding_height);
$padding.width(1);
}