Skip to content

Commit 4c57ad9

Browse files
committed
dispatch event when paused/resumed (closes #336)
1 parent 68fa39f commit 4c57ad9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

js/reveal.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,19 +928,31 @@ var Reveal = (function(){
928928
*/
929929
function pause() {
930930

931+
var wasPaused = dom.wrapper.classList.contains( 'paused' );
932+
931933
cancelAutoSlide();
932934
dom.wrapper.classList.add( 'paused' );
933935

936+
if( wasPaused === false ) {
937+
dispatchEvent( 'paused' );
938+
}
939+
934940
}
935941

936942
/**
937943
* Exits from the paused mode.
938944
*/
939945
function resume() {
940946

947+
var wasPaused = dom.wrapper.classList.contains( 'paused' );
948+
941949
cueAutoSlide();
942950
dom.wrapper.classList.remove( 'paused' );
943951

952+
if( wasPaused ) {
953+
dispatchEvent( 'resumed' );
954+
}
955+
944956
}
945957

946958
/**

0 commit comments

Comments
 (0)