dispatch event when paused/resumed (closes #336)
This commit is contained in:
parent
68fa39f083
commit
4c57ad918b
2 changed files with 14 additions and 2 deletions
12
js/reveal.js
12
js/reveal.js
|
@ -928,9 +928,15 @@ var Reveal = (function(){
|
||||||
*/
|
*/
|
||||||
function pause() {
|
function pause() {
|
||||||
|
|
||||||
|
var wasPaused = dom.wrapper.classList.contains( 'paused' );
|
||||||
|
|
||||||
cancelAutoSlide();
|
cancelAutoSlide();
|
||||||
dom.wrapper.classList.add( 'paused' );
|
dom.wrapper.classList.add( 'paused' );
|
||||||
|
|
||||||
|
if( wasPaused === false ) {
|
||||||
|
dispatchEvent( 'paused' );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -938,9 +944,15 @@ var Reveal = (function(){
|
||||||
*/
|
*/
|
||||||
function resume() {
|
function resume() {
|
||||||
|
|
||||||
|
var wasPaused = dom.wrapper.classList.contains( 'paused' );
|
||||||
|
|
||||||
cueAutoSlide();
|
cueAutoSlide();
|
||||||
dom.wrapper.classList.remove( 'paused' );
|
dom.wrapper.classList.remove( 'paused' );
|
||||||
|
|
||||||
|
if( wasPaused ) {
|
||||||
|
dispatchEvent( 'resumed' );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
4
js/reveal.min.js
vendored
4
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue