define type earlier
authorChristopher Schmidt <crschmidt@crschmidt.net>
Wed, 23 Apr 2008 16:39:20 +0000 (16:39 +0000)
committerChristopher Schmidt <crschmidt@crschmidt.net>
Wed, 23 Apr 2008 16:39:20 +0000 (16:39 +0000)
app/views/browse/start.rjs

index 5be4cffc645db60513a21b96d3e618d59fbe1465..783c387b2021b69099a99d1a26e6d39f347d4090 100644 (file)
@@ -279,6 +279,11 @@ page << <<EOJ
         div.appendChild(link)
         $("object").appendChild(div);    
         
+        var type = "way";
+        if (feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
+            type = "node";
+        }    
+        
         var link = document.createElement("a");   
         link.href =  "/browse/"+type+"/"+feature.osm_id;
         link.appendChild(document.createTextNode("Database entry for " + feature.osm_id));
@@ -291,10 +296,6 @@ page << <<EOJ
 
         // Now the list of attributes
         var ul = document.createElement("ul");
-        var type = "way";
-        if (feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
-            type = "node";
-        }    
         for (var key in feature.attributes) {
             var li = document.createElement("li");
             var b = document.createElement("b");