]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_id.html.erb
Cast the locale to a string
[rails.git] / app / views / site / _id.html.erb
index 8cb7bc8533dbb213e4fc22d1308d387183fa3fe7..e2f783731b7ff50f6107e5af77ee7661963724b8 100644 (file)
@@ -1,5 +1,7 @@
 <% if defined? ID_KEY %>
-  <iframe frameBorder="0" id="id-embed" class="id-embed"></iframe>
+  <div id="map">
+    <iframe frameBorder="0" id="id-embed" class="id-embed"></iframe>
+  </div>
   <script>
     var coord = {};
     <% if @lat && @lon && @zoom -%>
     <% end -%>
 
     var hash;
-    if (coord.object && coord.object.type !== 'relation') {
+    if (coord.object) {
       hash = '#id=' + coord.object.type[0] + coord.object.id;
     } else {
       hash = '#map=' + (coord.zoom || 17) + '/' + coord.lon + '/' + coord.lat
     }
 
-    $('#id-embed').attr('src', 'id_iframe' + hash);
+    $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>' + hash);
   </script>
 <% else %>
   <script type="text/javascript">alert("<%= t 'site.edit.id_not_configured' %>")</script>