]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_resize.html.erb
Eliminate interpolation in resize JS
[rails.git] / app / views / site / _resize.html.erb
index 4b312bf8c49927890a47d740a5f808df5800761b..baedc44640232532c24c182d69945baf170feab5 100644 (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);
   }
 
       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");