X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5e27978d3cd55b267f0222d51d9e8efa26e389e9..b9b255fa65813af95702b848cb084e2286345de9:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 44692eac1..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); @@ -171,16 +182,18 @@ $(document).ready(function () { $('.welcome .close-wrap').on('click', function() { $('.welcome').hide(); - $.cookie('_osm_welcome', 'hide', { expires: expiry }); + $.cookie('_osm_welcome', 'hide', { expires: expiry, path: '/' }); }); + var bannerExpiry = new Date(); + bannerExpiry.setYear(bannerExpiry.getFullYear() + 1); + $('#banner .close-wrap').on('click', function(e) { - debugger; var cookieId = e.target.id; $('#banner').hide(); e.preventDefault(); if (cookieId) { - $.cookie(cookieId, 'hide', { expires: expiry }); + $.cookie(cookieId, 'hide', { expires: bannerExpiry, path: '/' }); } });