Use size_blocks() in ui.left_userlist_get_new_heights().

This is a functional change.  Before this change, the stream
list and user list were allowed to take equal space in the left
sidebar; now, we take the size of each list in deciding which
proportion each block gets.

(imported from commit febedcb0518353825e18a6ebe60d1883b98bc78d)
This commit is contained in:
Steve Howell 2013-12-06 11:48:43 -05:00
parent c2034c210c
commit c1dcf38b0a
1 changed files with 11 additions and 17 deletions

View File

@ -447,25 +447,19 @@ function left_userlist_get_new_heights() {
- invite_user_link_height
- 15;
var blocks = [
{
real_height: stream_filters_real_height
},
{
real_height: user_list_real_height
}
];
res.stream_filters_max_height = Math.max(40, res.total_leftlist_height / 2);
res.user_presences_max_height = Math.max(40, res.total_leftlist_height / 2);
if (res.stream_filters_max_height > stream_filters_real_height) {
res.stream_filters_max_height = stream_filters_real_height;
res.user_presences_max_height = Math.max(40, res.total_leftlist_height
- stream_filters_real_height);
}
else if (res.user_presences_max_height > user_list_real_height) {
res.user_presences_max_height = user_list_real_height;
res.stream_filters_max_height = Math.max (40, res.total_leftlist_height
- user_list_real_height);
}
size_blocks(blocks, res.total_leftlist_height);
res.stream_filters_max_height = blocks[0].max_height;
res.user_presences_max_height = blocks[1].max_height;
res.viewport_height = viewport_height;
res.viewport_width = viewport_width;