diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2018-03-27 14:21:41 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2018-03-27 14:21:41 +0200 |
commit | 397feab8b4be5f8445ebb05808b507248188d4fe (patch) | |
tree | ba0b33208f63d4e9d259e3d9502d53a9787bc5db | |
parent | 93cacaa40c780f5fb4f6156851428f685aef5471 (diff) | |
download | perl-software-in-gnu-guix-397feab8b4be5f8445ebb05808b507248188d4fe.tar perl-software-in-gnu-guix-397feab8b4be5f8445ebb05808b507248188d4fe.tar.gz |
gracefully handle duplicate slide id's
-rw-r--r-- | js/reveal.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js index c6d05d5..2d85b89 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3781,7 +3781,10 @@ } 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 var indices = Reveal.getIndices( element ); slide( indices.h, indices.v ); |