1
0
Fork 0

gracefully handle duplicate slide id's

This commit is contained in:
Hakim El Hattab 2018-03-27 14:21:41 +02:00
parent 93cacaa40c
commit 397feab8b4
1 changed files with 4 additions and 1 deletions

View File

@ -3781,7 +3781,10 @@
} }
catch ( error ) { } catch ( error ) { }
if( element ) { // Ensure that we're not already on a slide with the same name
var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false;
if( element && !isSameNameAsCurrentSlide ) {
// Find the position of the named slide and navigate to it // Find the position of the named slide and navigate to it
var indices = Reveal.getIndices( element ); var indices = Reveal.getIndices( element );
slide( indices.h, indices.v ); slide( indices.h, indices.v );