X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d66f9960d12d739c44a89d1d4e013f52783097e7..8925f2b32fe3bfd9f9325cb7486c3b2058d25d0a:/src/wolnelektury/static/js/book_text/references.js?ds=inline diff --git a/src/wolnelektury/static/js/book_text/references.js b/src/wolnelektury/static/js/book_text/references.js index dcbb3c843..23f7b0302 100644 --- a/src/wolnelektury/static/js/book_text/references.js +++ b/src/wolnelektury/static/js/book_text/references.js @@ -4,8 +4,8 @@ if (interestingReferences) { interestingReferences = $.parseJSON(interestingReferences); } - if (interestingReferences) { - $("settings-references").show(); + if (Object.keys(interestingReferences).length) { + $("#settings-references").css('display', 'block'); } @@ -18,8 +18,8 @@ if (map_enabled) return; map = L.map('reference-map').setView([0, 0], 11); - L.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png?lang=pl', { - attribution: 'Map data © OpenStreetMap contributors' + L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=a8a97f0ae5134403ac38c1a075b03e15', { + attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors' }).addTo(map); map_enabled = true; @@ -29,14 +29,14 @@ } - $("#reference-close").on("click", function() { + $("#reference-close").on("click", function(event) { + event.preventDefault(); $("#reference-box").hide(); }); $('a.reference').each(function() { $this = $(this); uri = $this.attr('data-uri'); - console.log('check ' + uri); if (interestingReferences.hasOwnProperty(uri)) { $this.addClass('interesting'); ref = interestingReferences[uri];