Rewrite bbox only in place history atom links
This commit is contained in:
parent
2948b86eb5
commit
1fc2a70c17
2 changed files with 19 additions and 5 deletions
|
@ -48,6 +48,9 @@ OSM.History = function (map) {
|
||||||
|
|
||||||
if (window.location.pathname === "/history") {
|
if (window.location.pathname === "/history") {
|
||||||
data.bbox = map.getBounds().wrap().toBBoxString();
|
data.bbox = map.getBounds().wrap().toBBoxString();
|
||||||
|
var feedLink = $("link[type=\"application/atom+xml\"]"),
|
||||||
|
feedHref = feedLink.attr("href").split("?")[0];
|
||||||
|
feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -59,11 +62,6 @@ OSM.History = function (map) {
|
||||||
updateMap();
|
updateMap();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var feedLink = $("link[type=\"application/atom+xml\"]"),
|
|
||||||
feedHref = feedLink.attr("href").split("?")[0];
|
|
||||||
|
|
||||||
feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadMore(e) {
|
function loadMore(e) {
|
||||||
|
|
16
test/system/history_test.rb
Normal file
16
test/system/history_test.rb
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
require "application_system_test_case"
|
||||||
|
|
||||||
|
class HistoryTest < ApplicationSystemTestCase
|
||||||
|
test "atom link on user's history is not modified" do
|
||||||
|
user = create(:user)
|
||||||
|
create(:changeset, :user => user, :num_changes => 1) do |changeset|
|
||||||
|
create(:changeset_tag, :changeset => changeset, :k => "comment", :v => "first-changeset-in-history")
|
||||||
|
end
|
||||||
|
|
||||||
|
visit "#{user_path(user)}/history"
|
||||||
|
changesets = find "div.changesets"
|
||||||
|
changesets.assert_text "first-changeset-in-history"
|
||||||
|
|
||||||
|
assert_css "link[type='application/atom+xml'][href$='#{user_path(user)}/history/feed']", :visible => false
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue