mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	scrolling: Fix sidebar size calculation.
So the top navbar is above the left sidebar
on the z-axis, not the y-axis.
So it doesn't make sense to use the top
navbar in calculating the size of the left
sidebar.
It kind of coincidentally works, since these
two numbers are closely related:
    left sidebar top margin = 50
    navbar height = 40
Calculating `bottom_sidebar_height` correctly
decreases its value by 10.
And then the only value that depends on it
is `stream_filters_max_height`.  We were
subtracting out 10 there to make it work,
since `bottom_sidebar_height` was inaccurate
by +10.  Now that's fixed.
The comment there was inaccurate--the
`stream_filter` div actually has a bottom
margin of 22px.  The bottom margin does
have some consequences for scrolling,
but the main goal here is to make the
calculation return the same value but
be more accurate about what happens
toward the top of the screen.
			
			
This commit is contained in:
		@@ -56,15 +56,16 @@ function get_new_heights() {
 | 
			
		||||
 | 
			
		||||
    res.main_div_min_height = viewport_height - top_navbar_height;
 | 
			
		||||
 | 
			
		||||
    res.bottom_sidebar_height = viewport_height - top_navbar_height;
 | 
			
		||||
    res.bottom_sidebar_height = viewport_height
 | 
			
		||||
                                - parseInt($("#left-sidebar").css("marginTop"), 10)
 | 
			
		||||
                                - parseInt($(".bottom_sidebar").css("marginTop"), 10);
 | 
			
		||||
 | 
			
		||||
    res.right_sidebar_height = viewport_height - parseInt($("#right-sidebar").css("marginTop"), 10);
 | 
			
		||||
 | 
			
		||||
    res.stream_filters_max_height =
 | 
			
		||||
        res.bottom_sidebar_height
 | 
			
		||||
        - $("#global_filters").safeOuterHeight(true)
 | 
			
		||||
        - $("#streams_header").safeOuterHeight(true)
 | 
			
		||||
        - 10; // stream_filters margin-bottom
 | 
			
		||||
        - $("#streams_header").safeOuterHeight(true);
 | 
			
		||||
 | 
			
		||||
    // Don't let us crush the stream sidebar completely out of view
 | 
			
		||||
    res.stream_filters_max_height = Math.max(80, res.stream_filters_max_height);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user