From 3792551f481dff6174eb7d5afeb86ae9b90d517a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 12 Jul 2013 13:38:47 -0700 Subject: [PATCH] RTL support --- app/assets/javascripts/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index ae5fdb9d6..029c0bfd1 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -55,27 +55,30 @@ $(document).ready(function () { map.invalidateSize(); }); - L.OSM.zoom({position: 'topright'}) + var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright'; + + L.OSM.zoom({position: position}) .addTo(map); - L.control.locate({position: 'topright'}) + L.control.locate({position: position}) .addTo(map); var sidebar = L.OSM.sidebar('#map-ui') .addTo(map); L.OSM.layers({ - position: 'topright', + position: position, layers: layers, sidebar: sidebar }).addTo(map); L.OSM.key({ - position: 'topright', + position: position, sidebar: sidebar }).addTo(map); L.OSM.share({ + position: position, getShortUrl: getShortUrl, getUrl: getUrl, sidebar: sidebar, @@ -83,7 +86,7 @@ $(document).ready(function () { }).addTo(map); L.OSM.note({ - position: 'topright', + position: position, sidebar: sidebar }).addTo(map); -- 2.39.5