1 function resizeContent() {
2 var content = $("#content");
3 var leftMargin = parseInt(content.css("left"));
4 var rightMargin = parseInt(content.css("right"));
5 var bottomMargin = parseInt(content.css("bottom"));
7 if ($("html").attr("dir") == "ltr") {
8 content.width($(window).width() - content.prop("offsetLeft") - rightMargin);
10 content.width($(window).width() - content.prop("offsetRight") - leftMargin);
13 content.height($(window).height() - content.prop("offsetTop") - bottomMargin);
16 function resizeMap() {
17 var content_width = $("#content").width();
18 var content_height = $("#content").height();
19 var sidebar_width = 0;
20 var left_border = parseFloat($("#map").css("border-left-width"));
21 var right_border = parseFloat($("#map").css("border-right-width"));
22 var top_border = parseFloat($("#map").css("border-top-width"));
23 var bottom_border = parseFloat($("#map").css("border-bottom-width"));
25 $("#sidebar:visible").each(function () {
26 sidebar_width = sidebar_width + $(this).outerWidth(true);
29 if ($("html").attr("dir") == "ltr") {
30 $("#map").css("left", (sidebar_width) + "px");
32 $("#map").css("right", (sidebar_width) + "px");
35 $("#map").width(content_width - sidebar_width - left_border - right_border);
36 $("#map").height(content_height - top_border - bottom_border);
37 $("#map").trigger("resized");
40 function handleResize() {
41 var brokenContentSize = $("#content").prop("offsetWidth") == 0;
43 if (brokenContentSize) {
50 $(document).ready(function () {
51 $("#sidebar").on("opened", resizeMap);
52 $("#sidebar").on("closed", resizeMap);