From: Tom Hughes Date: Thu, 28 Mar 2013 14:43:07 +0000 (+0000) Subject: Fix display of updates on newly loaded notes X-Git-Tag: live~5096^2~9 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d00994d1511026b1540ecc14a9187b0c19a757b9 Fix display of updates on newly loaded notes --- diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index e67749f07..10e96df18 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -71,22 +71,22 @@ $(document).ready(function () { } function updateMarker(marker, feature) { - var icon = noteIcons[feature.properties.status]; - var popupContent = createPopupContent(marker, feature.properties); - if (marker) { marker.setIcon(noteIcons[feature.properties.status]); - marker._popup.setContent(popupContent); + marker._popup.setContent(createPopupContent(marker, feature.properties)); } else { marker = L.marker(feature.geometry.coordinates.reverse(), { - icon: icon, + icon: noteIcons[feature.properties.status], opacity: 0.7 }); - marker.addTo(noteLayer).bindPopup(popupContent, popupOptions()); + marker.addTo(noteLayer).bindPopup( + createPopupContent(marker, feature.properties), + popupOptions() + ); } return marker;