From 0d9a6419bb415524d36fb7870cb6949c8d35a8b7 Mon Sep 17 00:00:00 2001
From: Hakim El Hattab <hakim.elhattab@gmail.com>
Date: Fri, 30 Mar 2012 23:59:19 -0400
Subject: [PATCH] change back state event scope, document level makes more
 sense as that's where the state class is applied

---
 index.html   | 2 +-
 js/reveal.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.html b/index.html
index 327236c..e67b3e8 100644
--- a/index.html
+++ b/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 );
 
diff --git a/js/reveal.js b/js/reveal.js
index e35b8de..0fb4c61 100644
--- a/js/reveal.js
+++ b/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
-- 
GitLab