fix bug that prevented first-last slide looping in linear navigation mode (closes #3009)
This commit is contained in:
parent
abe9abbed7
commit
6727cd6ecb
2
dist/reveal.esm.js
vendored
2
dist/reveal.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js
vendored
2
dist/reveal.js
vendored
File diff suppressed because one or more lines are too long
@ -2275,11 +2275,16 @@ export default function( revealElement, options ) {
|
|||||||
previousSlide = Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR + '.past' ).pop();
|
previousSlide = Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR + '.past' ).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( previousSlide ) {
|
// When going backwards and arriving on a stack we start
|
||||||
|
// at the bottom of the stack
|
||||||
|
if( previousSlide && previousSlide.classList.contains( 'stack' ) ) {
|
||||||
let v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;
|
let v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;
|
||||||
let h = indexh - 1;
|
let h = indexh - 1;
|
||||||
slide( h, v );
|
slide( h, v );
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
navigateLeft({skipFragments});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +727,16 @@
|
|||||||
Reveal.right();
|
Reveal.right();
|
||||||
assert.equal( Reveal.getIndices().h, 0, 'looped from end to start' );
|
assert.equal( Reveal.getIndices().h, 0, 'looped from end to start' );
|
||||||
|
|
||||||
Reveal.configure({ loop: false });
|
Reveal.configure({ navigationMode: 'linear' });
|
||||||
|
Reveal.slide( 0, 0 );
|
||||||
|
|
||||||
|
Reveal.prev();
|
||||||
|
assert.notEqual( Reveal.getIndices().h, 0, 'looped from start to end in linear mode' );
|
||||||
|
|
||||||
|
Reveal.next();
|
||||||
|
assert.equal( Reveal.getIndices().h, 0, 'looped from end to start in linear mode' );
|
||||||
|
|
||||||
|
Reveal.configure({ loop: false, navigationMode: 'default' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user