Merge pull request #2263 from mbotsch/fix-readURL

Fix if-statement in readURL
This commit is contained in:
Hakim El Hattab 2018-10-25 13:00:03 +02:00 committed by GitHub
commit 4ac153c46f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -4070,10 +4070,13 @@
// Ensure that we're not already on a slide with the same name // Ensure that we're not already on a slide with the same name
var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false; var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false;
if( element && !isSameNameAsCurrentSlide ) { if( element ) {
// Find the position of the named slide and navigate to it // If the slide exists and is not the current slide...
var indices = Reveal.getIndices( element ); if ( !isSameNameAsCurrentSlide ) {
slide( indices.h, indices.v ); // ...find the position of the named slide and navigate to it
var indices = Reveal.getIndices(element);
slide(indices.h, indices.v);
}
} }
// If the slide doesn't exist, navigate to the current slide // If the slide doesn't exist, navigate to the current slide
else { else {