prevent repeated autoslidepaused/resumed events
This commit is contained in:
parent
3795ef1599
commit
4a39aecbab
22
js/reveal.js
22
js/reveal.js
|
@ -968,6 +968,8 @@ var Reveal = (function(){
|
||||||
*/
|
*/
|
||||||
function dispatchEvent( type, args ) {
|
function dispatchEvent( type, args ) {
|
||||||
|
|
||||||
|
console.log('event', type);
|
||||||
|
|
||||||
var event = document.createEvent( 'HTMLEvents', 1, 2 );
|
var event = document.createEvent( 'HTMLEvents', 1, 2 );
|
||||||
event.initEvent( type, true, true );
|
event.initEvent( type, true, true );
|
||||||
extend( event, args );
|
extend( event, args );
|
||||||
|
@ -2747,21 +2749,25 @@ var Reveal = (function(){
|
||||||
|
|
||||||
function pauseAutoSlide() {
|
function pauseAutoSlide() {
|
||||||
|
|
||||||
autoSlidePaused = true;
|
if( autoSlide && !autoSlidePaused ) {
|
||||||
dispatchEvent( 'autoslidepaused' );
|
autoSlidePaused = true;
|
||||||
clearTimeout( autoSlideTimeout );
|
dispatchEvent( 'autoslidepaused' );
|
||||||
|
clearTimeout( autoSlideTimeout );
|
||||||
|
|
||||||
if( autoSlidePlayer ) {
|
if( autoSlidePlayer ) {
|
||||||
autoSlidePlayer.setPlaying( false );
|
autoSlidePlayer.setPlaying( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resumeAutoSlide() {
|
function resumeAutoSlide() {
|
||||||
|
|
||||||
autoSlidePaused = false;
|
if( autoSlide && autoSlidePaused ) {
|
||||||
dispatchEvent( 'autoslideresumed' );
|
autoSlidePaused = false;
|
||||||
cueAutoSlide();
|
dispatchEvent( 'autoslideresumed' );
|
||||||
|
cueAutoSlide();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user