]> git.openstreetmap.org Git - rails.git/commitdiff
Remove unused, fix global leak
authorJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 13 Nov 2013 21:01:07 +0000 (13:01 -0800)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 13 Nov 2013 21:01:07 +0000 (13:01 -0800)
app/assets/javascripts/index/notes.js.erb

index 43c735a23fdc1f81d70ad81a50ae5cc9fd8ef9f2..3bcdd4a198dddc889dacab5bba7068669ab5e592 100644 (file)
@@ -1,7 +1,6 @@
 function initializeNotes(map) {
   var noteLayer = map.noteLayer,
 function initializeNotes(map) {
   var noteLayer = map.noteLayer,
-      notes = {},
-      newNote;
+      notes = {};
 
   var noteIcons = {
     "new": L.icon({
 
   var noteIcons = {
     "new": L.icon({
@@ -32,13 +31,6 @@ function initializeNotes(map) {
       noteLayer.clearLayers();
       notes = {};
     }
       noteLayer.clearLayers();
       notes = {};
     }
-  }).on("popupclose", function (e) {
-    if (newNote && e.popup == newNote._popup) {
-      $(newNote).oneTime(10, "removenote", function () {
-        map.removeLayer(newNote);
-        newNote = null;
-      });
-    } 
   });
 
   noteLayer.on('click', function(e) {
   });
 
   noteLayer.on('click', function(e) {
@@ -92,7 +84,7 @@ function initializeNotes(map) {
         notes[feature.properties.id] = updateMarker(marker, feature);
       }
 
         notes[feature.properties.id] = updateMarker(marker, feature);
       }
 
-      for (id in oldNotes) {
+      for (var id in oldNotes) {
         noteLayer.removeLayer(oldNotes[id]);
       }
 
         noteLayer.removeLayer(oldNotes[id]);
       }