41 lines
1.4 KiB
Text
41 lines
1.4 KiB
Text
<script type="text/javascript">
|
|
var brokenContentSize = $("#content").prop("offsetWidth") == 0;
|
|
|
|
function resizeContent() {
|
|
var content = $("#content");
|
|
var leftMargin = parseInt(content.css("left"));
|
|
var rightMargin = parseInt(content.css("right"));
|
|
var bottomMargin = parseInt(content.css("bottom"));
|
|
|
|
<% if t('html.dir') == "ltr" -%>
|
|
content.width($(window).width() - content.prop("offsetLeft") - rightMargin);
|
|
<% else -%>
|
|
content.width($(window).width() - content.prop("offsetRight") - leftMargin);
|
|
<% end -%>
|
|
content.height($(window).height() - content.prop("offsetTop") - bottomMargin);
|
|
}
|
|
|
|
function resizeMap() {
|
|
var sidebar_width = 0 + $("#sidebar:visible").outerWidth(true);
|
|
var left_border = 0 + $("#map").css("border-left-width");
|
|
var right_border = 0 + $("#map").css("border-right-width");
|
|
var top_border = 0 + $("#map").css("border-top-width");
|
|
var bottom_border = 0 + $("#map").css("border-bottom-width");
|
|
|
|
<% if t('html.dir') == "ltr" -%>
|
|
$("#map").css("left", (sidebar_width) + "px");
|
|
<% else -%>
|
|
$("#map").css("right", (sidebar_width) + "px");
|
|
<% end -%>
|
|
$("#map").width($("#content").width() - sidebar_width - left_border - right_border);
|
|
$("#map").height($("#content").height() - top_border - bottom_border);
|
|
}
|
|
|
|
function handleResize() {
|
|
if (brokenContentSize) {
|
|
resizeContent();
|
|
}
|
|
|
|
resizeMap();
|
|
}
|
|
</script>
|