From: Tom Hughes Date: Wed, 4 Dec 2013 08:41:56 +0000 (+0000) Subject: Position on notes correctly when a link to a comment is loaded X-Git-Tag: live~4561 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/b65ad205d17014744d43b8a6ac12fe0ab67e8fb0 Position on notes correctly when a link to a comment is loaded Links to note comments in the RSS feed have a #id on the end to position on the right comment, so don't let those hash strings stop the map from panning to the note. Fixes #603. --- diff --git a/app/assets/javascripts/index/note.js.erb b/app/assets/javascripts/index/note.js.erb index aa746265c..2a2599a3c 100644 --- a/app/assets/javascripts/index/note.js.erb +++ b/app/assets/javascripts/index/note.js.erb @@ -64,7 +64,7 @@ OSM.Note = function (map) { var data = $('.details').data(), latLng = data.coordinates.split(','); - if (!window.location.hash) { + if (!window.location.hash || window.location.hash.match(/^#?c[0-9]+$/)) { OSM.router.moveListenerOff(); map.once('moveend', OSM.router.moveListenerOn); map.getZoom() > 15 ? map.panTo(latLng) : map.setView(latLng, 16);