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
This commit is contained in:
Tom Hughes 2016-09-30 11:15:18 +01:00
parent a1ff77ec56
commit 6d9bddfa47

View file

@ -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);