Skip to content

Commit

Permalink
Merge pull request hakimel#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 authored Oct 25, 2018
2 parents 630e275 + 91b7949 commit e09991d
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 e09991d

Please sign in to comment.