Skip to content

Commit

Permalink
Merge pull request #2263 from mbotsch/fix-readURL
Browse files Browse the repository at this point in the history
Fix if-statement in readURL
  • Loading branch information
hakimel committed Oct 25, 2018
2 parents 7d66999 + 8a35a1e commit 4ac153c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4070,10 +4070,13 @@
// 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
var indices = Reveal.getIndices( element );
slide( indices.h, indices.v );
if( element ) {
// If the slide exists and is not the current slide...
if ( !isSameNameAsCurrentSlide ) {
// ...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
else {
Expand Down

0 comments on commit 4ac153c

Please sign in to comment.