Browse Source

dispatch event when paused/resumed (closes #336)

Hakim El Hattab 11 years ago
parent
commit
4c57ad918b
2 changed files with 13 additions and 1 deletions
  1. 12 0
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 12 - 0
js/reveal.js

@@ -928,9 +928,15 @@ var Reveal = (function(){
 	 */
 	function pause() {
 
+		var wasPaused = dom.wrapper.classList.contains( 'paused' );
+
 		cancelAutoSlide();
 		dom.wrapper.classList.add( 'paused' );
 
+		if( wasPaused === false ) {
+			dispatchEvent( 'paused' );
+		}
+
 	}
 
 	/**
@@ -938,9 +944,15 @@ var Reveal = (function(){
 	 */
 	function resume() {
 
+		var wasPaused = dom.wrapper.classList.contains( 'paused' );
+
 		cueAutoSlide();
 		dom.wrapper.classList.remove( 'paused' );
 
+		if( wasPaused ) {
+			dispatchEvent( 'resumed' );
+		}
+
 	}
 
 	/**

File diff suppressed because it is too large
+ 1 - 1
js/reveal.min.js


Some files were not shown because too many files changed in this diff