From d95361bcb9d1efccae1da3e295e426dfd44ddd89 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 2 Dec 2013 10:54:16 -0800 Subject: [PATCH] Support legacy bbox param on /history as well Fixes #586 --- app/assets/javascripts/index/history.js | 4 ++-- app/controllers/changeset_controller.rb | 2 +- test/functional/changeset_controller_test.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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" -- 2.43.2