Eliminate interpolation in resize JS

This commit is contained in:
John Firebaugh 2012-09-06 16:22:55 -07:00
parent 7ff77d9d3d
commit 21273d4164

View file

@ -7,11 +7,12 @@
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 -%>
if ($("html").attr("dir") == "ltr") {
content.width($(window).width() - content.prop("offsetLeft") - rightMargin);
} else {
content.width($(window).width() - content.prop("offsetRight") - leftMargin);
}
content.height($(window).height() - content.prop("offsetTop") - bottomMargin);
}
@ -28,11 +29,12 @@
sidebar_width = sidebar_width + $(this).outerWidth(true);
});
<% if t('html.dir') == "ltr" -%>
$("#map").css("left", (sidebar_width) + "px");
<% else -%>
$("#map").css("right", (sidebar_width) + "px");
<% end -%>
if ($("html").attr("dir") == "ltr") {
$("#map").css("left", (sidebar_width) + "px");
} else {
$("#map").css("right", (sidebar_width) + "px");
}
$("#map").width(content_width - sidebar_width - left_border - right_border);
$("#map").height(content_height - top_border - bottom_border);
$("#map").trigger("resized");