From: John Firebaugh Date: Mon, 2 Dec 2013 18:54:16 +0000 (-0800) Subject: Support legacy bbox param on /history as well X-Git-Tag: live~5195^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d95361bcb9d1efccae1da3e295e426dfd44ddd89 Support legacy bbox param on /history as well Fixes #586 --- diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 4a2b96be4..04f7c0731 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -44,10 +44,10 @@ OSM.History = function(map) { } function loadData() { - var data = {}; + var data = {list: '1'}; if (window.location.pathname === '/history') { - data = {bbox: map.getBounds().wrap().toBBoxString()}; + data.bbox = map.getBounds().wrap().toBBoxString(); } $.ajax({ diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index 5cd59c780..d34eb8739 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -268,7 +268,7 @@ class ChangesetController < ApplicationController return end - if request.format == :html and !params[:bbox] + if request.format == :html and !params[:list] require_oauth render :action => :history, :layout => map_layout else diff --git a/test/functional/changeset_controller_test.rb b/test/functional/changeset_controller_test.rb index 0db84a90b..09c316152 100644 --- a/test/functional/changeset_controller_test.rb +++ b/test/functional/changeset_controller_test.rb @@ -1721,7 +1721,7 @@ EOF assert_template "changeset/history" assert_select "h2", :text => "Changesets", :count => 1 - get :list, {:format => "html", :bbox => '-180,-90,90,180'} + get :list, {:format => "html", :list => '1', :bbox => '-180,-90,90,180'} assert_response :success assert_template "list"