From 6d9bddfa4741db3116b6e47ad090c3152f863d21 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 30 Sep 2016 11:15:18 +0100 Subject: [PATCH] Patch classes on the locate control This replaces the patching of the vendored source that we had been doing before and which we always forget to apply after updating it. Fixes #1306 --- app/assets/javascripts/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 5f84fb056..796a5f4d3 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -95,14 +95,25 @@ $(document).ready(function () { L.OSM.zoom({position: position}) .addTo(map); - L.control.locate({ + var locate = L.control.locate({ position: position, + icon: 'icon geolocate', + iconLoading: 'icon geolocate', strings: { title: I18n.t('javascripts.map.locate.title'), popup: I18n.t('javascripts.map.locate.popup') } }).addTo(map); + var locateContainer = locate.getContainer(); + + $(locateContainer) + .removeClass('leaflet-control-locate leaflet-bar') + .addClass('control-locate') + .children("a") + .removeClass('leaflet-bar-part leaflet-bar-part-single') + .addClass('control-button'); + var sidebar = L.OSM.sidebar('#map-ui') .addTo(map); -- 2.43.2