mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-14 16:35:07 +01:00
major cleanup of reader mode code
This commit is contained in:
parent
cc9a36dc25
commit
51acc830f9
6 changed files with 229 additions and 166 deletions
14
js/reveal.js
14
js/reveal.js
|
|
@ -1578,6 +1578,8 @@ export default function( revealElement, options ) {
|
|||
indexh = h;
|
||||
indexv = v;
|
||||
|
||||
const slideChanged = currentSlide !== slideElement;
|
||||
|
||||
previousSlide = currentSlide;
|
||||
currentSlide = slideElement;
|
||||
|
||||
|
|
@ -1588,6 +1590,17 @@ export default function( revealElement, options ) {
|
|||
}
|
||||
}
|
||||
|
||||
// Start or stop embedded content like videos and iframes
|
||||
if( slideChanged ) {
|
||||
if( previousSlide ) {
|
||||
slideContent.stopEmbeddedContent( previousSlide );
|
||||
slideContent.stopEmbeddedContent( previousSlide.slideBackgroundElement );
|
||||
}
|
||||
|
||||
slideContent.startEmbeddedContent( currentSlide );
|
||||
slideContent.startEmbeddedContent( currentSlide.slideBackgroundElement );
|
||||
}
|
||||
|
||||
requestAnimationFrame( () => {
|
||||
announceStatus( getStatusText( currentSlide ) );
|
||||
});
|
||||
|
|
@ -2132,6 +2145,7 @@ export default function( revealElement, options ) {
|
|||
|
||||
// If a slide is specified, return the indices of that slide
|
||||
if( slide ) {
|
||||
// In reader mode the original h/x index is stored on the slide
|
||||
if( reader.isActive() ) {
|
||||
h = parseInt( slide.getAttribute( 'data-index-h' ), 10 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue