]> git.openstreetmap.org Git - rails.git/commitdiff
Fix display of updates on newly loaded notes
authorTom Hughes <tom@compton.nu>
Thu, 28 Mar 2013 14:43:07 +0000 (14:43 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 28 Mar 2013 14:43:07 +0000 (14:43 +0000)
app/assets/javascripts/index/notes.js.erb

index e67749f07d20cbc44e1d188bae244fe0d8912322..10e96df189e69303c0dfb511e588bddc3f637ab2 100644 (file)
@@ -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;