X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c4c0e8105a8edc35205add749f461ec7be689aef..374668c7cc06da7e76f5d447056d13022947886c:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index fd707e566..039cc0ef6 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -21,8 +21,11 @@ //= require index/query //= require router //= require bowser +//= require querystring $(document).ready(function () { + var querystring = require("querystring-component"); + var loaderTimeout; var map = new L.OSM.Map("map", { @@ -32,6 +35,8 @@ $(document).ready(function () { }); OSM.loadSidebarContent = function (path, callback) { + var content_path = path; + map.setSidebarOverlaid(false); clearTimeout(loaderTimeout); @@ -42,17 +47,17 @@ $(document).ready(function () { // 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); @@ -342,6 +347,10 @@ $(document).ready(function () { }); } }); + + $(".colour-preview-box").each(function () { + $(this).css("background-color", $(this).data("colour")); + }); } page.unload = function () {