1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-05 06:07:37 +02:00

jump-to-slide is 1-indexed, falls back on word search

This commit is contained in:
hakimel
2023-01-17 09:49:49 +01:00
parent b648a56009
commit efcc86273b
8 changed files with 43 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ export default class Location {
*
* @returns slide indices or null
*/
getIndicesFromHash( hash=window.location.hash ) {
getIndicesFromHash( hash=window.location.hash, options={} ) {
// Attempt to parse the hash as either an index or name
let name = hash.replace( /^#\/?/, '' );
@@ -72,7 +72,7 @@ export default class Location {
}
else {
const config = this.Reveal.getConfig();
let hashIndexBase = config.hashOneBasedIndex ? 1 : 0;
let hashIndexBase = config.hashOneBasedIndex || options.oneBasedIndex ? 1 : 0;
// Read the index components of the hash
let h = ( parseInt( bits[0], 10 ) - hashIndexBase ) || 0,