mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
This commit was originally automatically generated using `tools/lint --only=eslint --fix`. It was then modified by tabbott to contain only changes to a set of files that are unlikely to result in significant merge conflicts with any open pull request, excluding about 20 files. His plan is to merge the remaining changes with more precise care, potentially involving merging parts of conflicting pull requests before running the `eslint --fix` operation. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
24 lines
578 B
JavaScript
24 lines
578 B
JavaScript
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;
|