Fix editing notes outside of view, closes #57
authorAaron Lidman <aaronlidman@gmail.com>
Wed, 13 Nov 2013 00:58:03 +0000 (16:58 -0800)
committerAaron Lidman <aaronlidman@gmail.com>
Wed, 13 Nov 2013 00:58:03 +0000 (16:58 -0800)
app/assets/javascripts/index/note.js.erb

index b6b464f73c631e9904b6b0a76ef96e7a44cf5f37..afc23006732a772f8bc66221a469ddd1c01f9bdb 100644 (file)
@@ -35,10 +35,10 @@ OSM.Note = function (map) {
         marker = noteLayer.getLayer(marker);
         if (feature.properties.status == "hidden") {
           noteLayer.removeLayer(marker);
-        } else {
+        } else if (marker) {
           marker.setIcon(noteIcons[feature.properties.status]);
-          page.load();
         }
+        page.load();
       }
     });
   }