From 66811558659c5b0e4b276e0be185e64a522846ff Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 5 Nov 2013 15:57:03 -0800 Subject: [PATCH] Fix map controls on user settings page --- app/assets/javascripts/diary_entry.js | 3 ++- app/assets/javascripts/user.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/diary_entry.js b/app/assets/javascripts/diary_entry.js index 1aa728ea0..5a19cb4d6 100644 --- a/app/assets/javascripts/diary_entry.js +++ b/app/assets/javascripts/diary_entry.js @@ -21,13 +21,14 @@ $(document).ready(function () { var params = $("#map").data(); var centre = [params.lat, params.lon]; + var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright'; map = L.map("map", { attributionControl: false, zoomControl: false }).addLayer(new L.OSM.Mapnik()); - L.OSM.zoom() + L.OSM.zoom({position: position}) .addTo(map); map.setView(centre, params.zoom); diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 80b505915..6a0d38dd5 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -6,10 +6,13 @@ $(document).ready(function () { zoomControl: false }).addLayer(new L.OSM.Mapnik()); - L.OSM.zoom() + var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright'; + + L.OSM.zoom({position: position}) .addTo(map); L.control.locate({ + position: position, strings: { title: I18n.t('javascripts.map.locate.title'), popup: I18n.t('javascripts.map.locate.popup') -- 2.39.5