]> git.openstreetmap.org Git - rails.git/commitdiff
Replace use of Event with jQuery methods
authorTom Hughes <tom@compton.nu>
Sat, 30 Jun 2012 13:57:18 +0000 (14:57 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 30 Jun 2012 13:59:22 +0000 (14:59 +0100)
Versions of OpenLayers before 2.12 provided a global Event object
but this has now been removed, so use jQuery methods instead.

app/views/changeset/_map.html.erb
app/views/site/index.html.erb

index 88dd53c99a8e7847ee51119148bca318ea72405a..a490ad1d89465e9c0e853127017ab1a2a1bd4cc9 100644 (file)
@@ -37,7 +37,7 @@
     $("#tr-changeset-" + id).removeClass("selected");
   }
 
     $("#tr-changeset-" + id).removeClass("selected");
   }
 
-  function init() {
+  $(document).ready(function () {
     var map = createMap("changeset_list_map", {
       controls: [
         new OpenLayers.Control.Navigation(),
     var map = createMap("changeset_list_map", {
       controls: [
         new OpenLayers.Control.Navigation(),
@@ -84,7 +84,5 @@
     <% else %>
       map.zoomToExtent(proj(bounds));
     <% end %>
     <% else %>
       map.zoomToExtent(proj(bounds));
     <% end %>
-  }
-
-  Event.observe(window, "load", init);
+  });
 </script>
 </script>
index a74c7b356032433cad85a6726fd69108f48f5b14..b7a9df068c618b042d522b389b3674abf2a50e0e 100644 (file)
@@ -288,7 +288,7 @@ end
   $(document).ready(function () {
     $("#exportanchor").click(function (e) {
       $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
   $(document).ready(function () {
     $("#exportanchor").click(function (e) {
       $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
-      Event.stop(e);
+      e.preventDefault();
     });
 
     <% if params[:action] == 'export' -%>
     });
 
     <% if params[:action] == 'export' -%>