mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 10:31:42 +00:00
Bug fixes and map page banner
This commit is contained in:
+12
-2
@@ -68,8 +68,6 @@ function loadSpots() {
|
||||
// now
|
||||
startSSEConnection();
|
||||
}
|
||||
// Start the ongoing SSE connection
|
||||
startSSEConnection();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -594,6 +592,16 @@ function setUpMap() {
|
||||
map.setView([30, 0], 3);
|
||||
}
|
||||
|
||||
// Display the intro box, unless the user has already dismissed it once.
|
||||
function displayIntroBox() {
|
||||
if (localStorage.getItem("map-intro-box-dismissed") == null) {
|
||||
$("#map-intro-box").show();
|
||||
}
|
||||
$("#map-intro-box-dismiss").click(function () {
|
||||
localStorage.setItem("map-intro-box-dismissed", true);
|
||||
});
|
||||
}
|
||||
|
||||
// Startup
|
||||
$(document).ready(function () {
|
||||
// Close SSE connection cleanly when navigating away
|
||||
@@ -609,6 +617,8 @@ $(document).ready(function () {
|
||||
setUpMap();
|
||||
// Call loadOptions(), this will then trigger loading spots and setting up timers.
|
||||
loadOptions();
|
||||
// Display intro box
|
||||
displayIntroBox();
|
||||
// Prevent mouse scroll and touch actions in the popup menus being passed through to the map
|
||||
L.DomEvent.disableScrollPropagation(document.getElementById('settingsButtonRowMap'));
|
||||
L.DomEvent.disableClickPropagation(document.getElementById('settingsButtonRowMap'));
|
||||
|
||||
Reference in New Issue
Block a user