mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
Reduce repeated height calculations in get_new_heights.
(imported from commit bc5422519d048d6be6bc53e16bd1597d704c1ff5)
This commit is contained in:
@@ -267,23 +267,19 @@ function need_skinny_mode() {
|
|||||||
|
|
||||||
function get_new_heights() {
|
function get_new_heights() {
|
||||||
var res = {};
|
var res = {};
|
||||||
|
var viewport_height = viewport.height();
|
||||||
|
var top_navbar_height = $("#top_navbar").height();
|
||||||
|
|
||||||
res.bottom_whitespace_height =
|
res.bottom_whitespace_height = viewport_height * 0.4;
|
||||||
viewport.height() * 0.4;
|
|
||||||
|
|
||||||
res.main_div_min_height =
|
res.main_div_min_height = viewport_height - top_navbar_height;
|
||||||
viewport.height()
|
|
||||||
- $("#top_navbar").height();
|
|
||||||
|
|
||||||
res.bottom_sidebar_height =
|
res.bottom_sidebar_height = viewport_height - top_navbar_height
|
||||||
viewport.height()
|
|
||||||
- $("#top_navbar").height()
|
|
||||||
- $(".upper_sidebar").height()
|
- $(".upper_sidebar").height()
|
||||||
- 40;
|
- 40;
|
||||||
|
|
||||||
res.right_sidebar_height =
|
res.right_sidebar_height =
|
||||||
viewport.height()
|
viewport_height - top_navbar_height
|
||||||
- $("#top_navbar").height()
|
|
||||||
- $("#notifications-area").height()
|
- $("#notifications-area").height()
|
||||||
- 14 // margin for right sidebar
|
- 14 // margin for right sidebar
|
||||||
- 10; // padding on notifications bar
|
- 10; // padding on notifications bar
|
||||||
|
|||||||
Reference in New Issue
Block a user