projects
/
reveal.js.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8312368
)
Firing custom event based on data-state name. This allows developers to trigger custo...
author
Andy Matthews
<andy@commadelimited.com>
Fri, 30 Mar 2012 11:51:54 +0000
(06:51 -0500)
committer
Andy Matthews
<andy@commadelimited.com>
Fri, 30 Mar 2012 11:51:54 +0000
(06:51 -0500)
js/reveal.js
patch
|
blob
|
history
diff --git
a/js/reveal.js
b/js/reveal.js
index 1e6ce4d70590018f27f86647f68a1ab4e7576db3..49c4bc9d13ab94215214f205dd5ae9c9af28bfc1 100644
(file)
--- a/
js/reveal.js
+++ b/
js/reveal.js
@@
-501,6
+501,10
@@
var Reveal = (function(){
// Apply the new state
for( var i = 0, len = state.length; i < len; i++ ) {
document.documentElement.classList.add( state[i] );
+ // dispatch custom event
+ var event = document.createEvent("HTMLEvents");
+ event.initEvent(state[i], true, true);
+ document.dispatchEvent(event);
}
// Update progress if enabled