]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/browse/start.js.erb
Fixing review comments
[rails.git] / app / views / browse / start.js.erb
index e986213a7c00d84d747fb97f24fd9417e2120dc3..9513652689646e93ad6d149c0ab3a51499aea110 100644 (file)
@@ -32,7 +32,7 @@ function startBrowse() {
   browseBoxControl.handler.callbacks.done = endDrag;
   map.addControl(browseBoxControl);
 
-  map.events.register("moveend", map, showData);
+  map.events.register("moveend", map, updateData);
   map.events.triggerEvent("moveend");
 
   $("#browse_select_box").click(startDrag);
@@ -42,7 +42,7 @@ function startBrowse() {
   $("#browse_hide_areas_box").click(hideAreas);
 }
 
-function showData() {
+function updateData() {
   if (browseMode == "auto") {
     if (map.getZoom() >= 15) {
         useMap(false);
@@ -77,7 +77,7 @@ function stopBrowse() {
     } 
 
     map.dataLayer.setVisibility(false);
-    map.events.unregister("moveend", map, showData);
+    map.events.unregister("moveend", map, updateData);
   }    
 }
 
@@ -428,8 +428,8 @@ function loadHistory() {
   this.link.href = "";
   this.link.innerHTML = "<%=j t 'browse.start_rjs.wait' %>";
 
-  new Ajax.Request("/api/<%= API_VERSION %>/" + this.type + "/" + this.feature.osm_id + "/history", {
-    onComplete: OpenLayers.Function.bind(displayHistory, this)
+  $.ajax("/api/<%= API_VERSION %>/" + this.type + "/" + this.feature.osm_id + "/history", {
+    complete: OpenLayers.Function.bind(displayHistory, this)
   });
 
   return false;