X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0f3856fd1c83e4cd92e34b18e047878505888051..48ed305163ac44e420de60d7ffc5af1a1c3950c2:/app/assets/javascripts/index/history.js?ds=sidebyside diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index fe64c2959..d137b8456 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -1,4 +1,4 @@ -//= require jquery.simulate +//= require jquery-simulate/jquery.simulate OSM.History = function (map) { var page = {}; @@ -10,18 +10,6 @@ OSM.History = function (map) { }) .on("mouseout", "[data-changeset]", function () { unHighlightChangeset($(this).data("changeset").id); - }) - .on("mousedown", "[data-changeset]", function () { - var moved = false; - $(this) - .one("click", function (e) { - if (!moved && !$(e.target).is("a")) { - clickChangeset($(this).data("changeset").id, e); - } - }) - .one("mousemove", function () { - moved = true; - }); }); var group = L.featureGroup() @@ -41,13 +29,13 @@ OSM.History = function (map) { function highlightChangeset(id) { var layer = group.getLayer(id); - if ( layer ) layer.setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 }); + if (layer) layer.setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 }); $("#changeset_" + id).addClass("selected"); } function unHighlightChangeset(id) { var layer = group.getLayer(id); - if ( layer ) layer.setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 }); + if (layer) layer.setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 }); $("#changeset_" + id).removeClass("selected"); } @@ -60,6 +48,9 @@ OSM.History = function (map) { if (window.location.pathname === "/history") { 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({ @@ -71,11 +62,6 @@ OSM.History = function (map) { updateMap(); } }); - - var feedLink = $("link[type=\"application/atom+xml\"]"), - feedHref = feedLink.attr("href").split("?")[0]; - - feedLink.attr("href", feedHref + "?bbox=" + data.bbox); } function loadMore(e) {