aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-03-27 14:21:41 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-03-27 14:21:41 +0200
commit397feab8b4be5f8445ebb05808b507248188d4fe (patch)
treeba0b33208f63d4e9d259e3d9502d53a9787bc5db /js
parent93cacaa40c780f5fb4f6156851428f685aef5471 (diff)
downloadperl-software-in-gnu-guix-397feab8b4be5f8445ebb05808b507248188d4fe.tar
perl-software-in-gnu-guix-397feab8b4be5f8445ebb05808b507248188d4fe.tar.gz
gracefully handle duplicate slide id's
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js5
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 );