From 21273d41644554c3366b3fc35986a7e56d77ab17 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 6 Sep 2012 16:22:55 -0700 Subject: [PATCH] Eliminate interpolation in resize JS --- app/views/site/_resize.html.erb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/views/site/_resize.html.erb b/app/views/site/_resize.html.erb index 4b312bf8c..baedc4464 100644 --- a/app/views/site/_resize.html.erb +++ b/app/views/site/_resize.html.erb @@ -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"); -- 2.39.5