Преглед на файлове

change back state event scope, document level makes more sense as that's where the state class is applied

Hakim El Hattab преди 12 години
родител
ревизия
0d9a6419bb
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      index.html
  2. 2 2
      js/reveal.js

+ 1 - 1
index.html

@@ -255,7 +255,7 @@
 
 			// Example of binding an event to a state. This listener will trigger
 			// when the slide with 'data-state="blurred"' is opened.
-			document.querySelector( '#reveal' ).addEventListener( 'blurred', function() {
+			document.addEventListener( 'blurred', function() {
 				
 			}, false );
 

+ 2 - 2
js/reveal.js

@@ -513,8 +513,8 @@ var Reveal = (function(){
 
 			// Dispatch custom event
 			var event = document.createEvent( "HTMLEvents" );
-			event.initEvent( state[i], false, true );
-			dom.wrapper.dispatchEvent( event );
+			event.initEvent( state[i], true, true );
+			document.dispatchEvent( event );
 		}
 
 		// Clean up the remaints of the previous state