mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 11:33:51 +00:00
ES and TypeScript modules are strict by default and don’t need this directive. ESLint will remind us to add it to new CommonJS files and remove it from ES and TypeScript modules. Signed-off-by: Anders Kaseorg <anders@zulip.com>
25 lines
592 B
JavaScript
25 lines
592 B
JavaScript
"use strict";
|
|
|
|
exports.update_padding = function (opts) {
|
|
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);
|
|
return;
|
|
}
|
|
|
|
const ratio = hidden_rows / shown_rows;
|
|
|
|
const content_height = content.height();
|
|
const new_padding_height = ratio * content_height;
|
|
|
|
padding.height(new_padding_height);
|
|
padding.width(1);
|
|
};
|
|
|
|
window.padded_widget = exports;
|