});
OSM.loadSidebarContent = function (path, callback) {
+ var content_path = path;
+
map.setSidebarOverlaid(false);
clearTimeout(loaderTimeout);
// IE<10 doesn't respect Vary: X-Requested-With header, so
// prevent caching the XHR response as a full-page URL.
- if (path.indexOf("?") >= 0) {
- path += "&xhr=1";
+ if (content_path.indexOf("?") >= 0) {
+ content_path += "&xhr=1";
} else {
- path += "?xhr=1";
+ content_path += "?xhr=1";
}
$("#sidebar_content")
.empty();
$.ajax({
- url: path,
+ url: content_path,
dataType: "html",
complete: function (xhr) {
clearTimeout(loaderTimeout);
e.preventDefault();
var data = $(this).data(),
- center = L.latLng(data.lat, data.lon);
+ center = L.latLng(data.lat, data.lon);
map.setView(center, data.zoom);
L.marker(center, { icon: OSM.getUserIcon() }).addTo(map);
if (object) query.select = object.type + object.id;
var iframe = $("<iframe>")
- .hide()
- .appendTo("body")
- .attr("src", url + querystring.stringify(query))
- .on("load", function () {
- $(this).remove();
- loaded = true;
- });
+ .hide()
+ .appendTo("body")
+ .attr("src", url + qs.stringify(query))
+ .on("load", function () {
+ $(this).remove();
+ loaded = true;
+ });
setTimeout(function () {
if (!loaded) {
};
page.load = function () {
- var params = querystring.parse(location.search.substring(1));
+ var params = qs.parse(location.search.substring(1));
if (params.query) {
$("#sidebar .search_form input[name=query]").value(params.query);
}