Avoid having to condition on mobile mode

This commit is contained in:
Tom Hughes 2011-11-26 18:12:58 +00:00
parent 080d347d8f
commit 9afbaf1984
4 changed files with 10 additions and 9 deletions

View file

@ -106,6 +106,7 @@ html body {
#sidebar { #sidebar {
left: 0px; left: 0px;
margin-right: 3px;
} }
#sidebar #sidebar_title { #sidebar #sidebar_title {

View file

@ -107,6 +107,7 @@ html body {
#sidebar { #sidebar {
right: 0px; right: 0px;
margin-left: 3px;
} }
#sidebar #sidebar_title { #sidebar #sidebar_title {

View file

@ -118,6 +118,7 @@ h1 {
#sidebar { #sidebar {
border: 0px; border: 0px;
border-right: 1px solid #ccccdd; border-right: 1px solid #ccccdd;
margin: 0px;
} }
.sidebar_title, #sidebar_content { .sidebar_title, #sidebar_content {

View file

@ -16,21 +16,19 @@
} }
function resizeMap() { function resizeMap() {
var sidebar_width = 0 + $("#sidebar:visible").width(); var sidebar_width = 0 + $("#sidebar:visible").outerWidth(true);
var left_border = 0 + $("#map").css("border-left-width");
if (sidebar_width > 0 && window.width > 641) { var right_border = 0 + $("#map").css("border-right-width");
sidebar_width = sidebar_width + 5 var top_border = 0 + $("#map").css("border-top-width");
} var bottom_border = 0 + $("#map").css("border-bottom-width");
<% if t('html.dir') == "ltr" -%> <% if t('html.dir') == "ltr" -%>
$("#map").css("left", (sidebar_width) + "px"); $("#map").css("left", (sidebar_width) + "px");
<% else -%> <% else -%>
$("#map").css("right", (sidebar_width) + "px"); $("#map").css("right", (sidebar_width) + "px");
<% end -%> <% end -%>
$("#map").width($("#content").width() - sidebar_width); $("#map").width($("#content").width() - sidebar_width - left_border - right_border);
if (window.width > 641) { $("#map").height($("#content").height() - top_border - bottom_border);
$("#map").height($("#content").height() - 2);
}
} }
function handleResize() { function handleResize() {