aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMario Botsch <botsch@techfak.uni-bielefeld.de>2018-10-24 23:22:11 +0200
committerMario Botsch <botsch@techfak.uni-bielefeld.de>2018-10-24 23:22:11 +0200
commit8a35a1e1ed9b0579f1e549273348a0477167c207 (patch)
tree289eb9b250c11319396649e02c0cb3dc444e5f88 /js
parent7d66999c7fc1459889df9efdb37f4befa8129135 (diff)
downloadperl-software-in-gnu-guix-8a35a1e1ed9b0579f1e549273348a0477167c207.tar
perl-software-in-gnu-guix-8a35a1e1ed9b0579f1e549273348a0477167c207.tar.gz
Fix nested if-statement in readURL that caused slide(h,v) to be
called even when the current slide is the target slide.
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js
index d78d3a9..f797084 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -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 {