1
0
Fork 0

Made one based indexing optional

This commit is contained in:
Sean Parent 2018-03-23 10:07:42 -07:00
parent 443b4475bc
commit 64b2a27455
1 changed files with 8 additions and 4 deletions

View File

@ -69,6 +69,10 @@
// Display the page number of the current slide // Display the page number of the current slide
slideNumber: false, 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 // Determine which displays to show the slide number on
showSlideNumber: 'all', showSlideNumber: 'all',
@ -2208,8 +2212,8 @@
} }
// Otherwise use the /h/v index (adding 1 to match slide label) // Otherwise use the /h/v index (adding 1 to match slide label)
else { else {
if( indexh > 0 || indexv > 0 ) url += indexh + 1; if( indexh > 0 || indexv > 0 ) url += indexh + config.hashOneBasedIndex;
if( indexv > 0 ) url += '/' + indexv + 1; if( indexv > 0 ) url += '/' + (indexv + config.hashOneBasedIndex);
} }
return url; return url;
@ -3741,8 +3745,8 @@
} }
else { else {
// Read the index components of the hash // Read the index components of the hash
var h = (parseInt( bits[0], 10 ) || 0) - 1, var h = (parseInt( bits[0], 10 ) || 0) - config.hashOneBasedIndex,
v = (parseInt( bits[1], 10 ) || 0) - 1; v = (parseInt( bits[1], 10 ) || 0) - config.hashOneBasedIndex;
if( h !== indexh || v !== indexv ) { if( h !== indexh || v !== indexv ) {
slide( h, v ); slide( h, v );