aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSean Parent <sean.parent@stlab.cc>2018-03-23 10:07:42 -0700
committerSean Parent <sean.parent@stlab.cc>2018-03-23 10:07:42 -0700
commit64b2a27455240e57c2cc1a90300391a3c3b91e28 (patch)
treebfbf00ef65348107ce28c9dcd6995ef816f458da /js
parent443b4475bc3b0171f45519b52919e701ec401fb2 (diff)
downloadperl-software-in-gnu-guix-64b2a27455240e57c2cc1a90300391a3c3b91e28.tar
perl-software-in-gnu-guix-64b2a27455240e57c2cc1a90300391a3c3b91e28.tar.gz
Made one based indexing optional
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js
index e636219..25abc3a 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -68,6 +68,10 @@
// Display the page number of the current slide
slideNumber: false,
+
+ // Use 1 based indexing for # links to match slide number (default is zero
+ // based)
+ hashOneBasedIndex: false,
// Determine which displays to show the slide number on
showSlideNumber: 'all',
@@ -2208,8 +2212,8 @@
}
// Otherwise use the /h/v index (adding 1 to match slide label)
else {
- if( indexh > 0 || indexv > 0 ) url += indexh + 1;
- if( indexv > 0 ) url += '/' + indexv + 1;
+ if( indexh > 0 || indexv > 0 ) url += indexh + config.hashOneBasedIndex;
+ if( indexv > 0 ) url += '/' + (indexv + config.hashOneBasedIndex);
}
return url;
@@ -3741,8 +3745,8 @@
}
else {
// Read the index components of the hash
- var h = (parseInt( bits[0], 10 ) || 0) - 1,
- v = (parseInt( bits[1], 10 ) || 0) - 1;
+ var h = (parseInt( bits[0], 10 ) || 0) - config.hashOneBasedIndex,
+ v = (parseInt( bits[1], 10 ) || 0) - config.hashOneBasedIndex;
if( h !== indexh || v !== indexv ) {
slide( h, v );