mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	js: Prefix jQuery object variable names with $.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user