X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/71cb2c50fcaf29e2b933fc981e40a00223d94d34..21a08ca546377ca2edd074abc8120c19685091b7:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 8ffa05c53..820c268b6 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -12,9 +12,9 @@ //= require leaflet.contextmenu //= require index/contextmenu //= require index/search -//= require index/browse +//= require index/layers/data //= require index/export -//= require index/notes +//= require index/layers/notes //= require index/history //= require index/note //= require index/new_note @@ -160,12 +160,12 @@ $(document).ready(function () { OSM.initializeContextMenu(map); if (OSM.STATUS !== "api_offline" && OSM.STATUS !== "database_offline") { - OSM.initializeNotes(map); + OSM.initializeNotesLayer(map); if (params.layers.indexOf(map.noteLayer.options.code) >= 0) { map.addLayer(map.noteLayer); } - OSM.initializeBrowse(map); + OSM.initializeDataLayer(map); if (params.layers.indexOf(map.dataLayer.options.code) >= 0) { map.addLayer(map.dataLayer); } @@ -396,7 +396,7 @@ $(document).ready(function () { OSM.router.load(); $(document).on("click", "a", function (e) { - if (e.isDefaultPrevented() || e.isPropagationStopped()) { + if (e.isDefaultPrevented() || e.isPropagationStopped() || $(e.target).data("turbo")) { return; } @@ -412,6 +412,9 @@ $(document).ready(function () { if (OSM.router.route(this.pathname + this.search + this.hash)) { e.preventDefault(); + if (this.pathname !== "/directions") { + $("header").addClass("closed"); + } } });