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 {
left: 0px;
margin-right: 3px;
}
#sidebar #sidebar_title {

View file

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

View file

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

View file

@ -16,21 +16,19 @@
}
function resizeMap() {
var sidebar_width = 0 + $("#sidebar:visible").width();
if (sidebar_width > 0 && window.width > 641) {
sidebar_width = sidebar_width + 5
}
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);
if (window.width > 641) {
$("#map").height($("#content").height() - 2);
}
$("#map").width($("#content").width() - sidebar_width - left_border - right_border);
$("#map").height($("#content").height() - top_border - bottom_border);
}
function handleResize() {