From f87f68b8072b28830db7bd8600b7fde40e6c8989 Mon Sep 17 00:00:00 2001 From: ilyankou Date: Fri, 7 Oct 2022 19:11:29 +0100 Subject: [PATCH 1/2] Allow custom marker numbering --- scripts/storymap.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/storymap.js b/scripts/storymap.js index fc1e11f4..d69e45cb 100644 --- a/scripts/storymap.js +++ b/scripts/storymap.js @@ -153,7 +153,11 @@ $(window).on('load', function() { L.marker([lat, lon], { icon: L.ExtraMarkers.icon({ icon: 'fa-number', - number: c['Marker'] === 'Plain' ? '' : chapterCount, + number: (c['Marker'] === 'Numbered' || c['Marker'] === '') + ? chapterCount + : (c['Marker'] === 'Plain' + ? '' + : c['Marker']), markerColor: c['Marker Color'] || 'blue' }), opacity: c['Marker'] === 'Hidden' ? 0 : 0.9, @@ -290,7 +294,7 @@ $(window).on('load', function() { ) { // Update URL hash - location.hash = i + 2; + location.hash = i + 1; // Remove styling for the old in-focus chapter and // add it to the new active chapter @@ -441,7 +445,7 @@ $(window).on('load', function() { // On first load, check hash and if it contains an number, scroll down if (parseInt(location.hash.substr(1))) { - var containerId = parseInt( location.hash.substr(1) ) - 2; + var containerId = parseInt( location.hash.substr(1) ) - 1; $('#contents').animate({ scrollTop: $('#container' + containerId).offset().top }, 2000); From e4bdcbb96ecfbc84e3ff09f9698073a5a13bc5b8 Mon Sep 17 00:00:00 2001 From: ilyankou Date: Fri, 7 Oct 2022 19:15:01 +0100 Subject: [PATCH 2/2] Fix plain marker behaviour --- scripts/storymap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/storymap.js b/scripts/storymap.js index d69e45cb..2bb49b38 100644 --- a/scripts/storymap.js +++ b/scripts/storymap.js @@ -153,7 +153,7 @@ $(window).on('load', function() { L.marker([lat, lon], { icon: L.ExtraMarkers.icon({ icon: 'fa-number', - number: (c['Marker'] === 'Numbered' || c['Marker'] === '') + number: c['Marker'] === 'Numbered' ? chapterCount : (c['Marker'] === 'Plain' ? ''