aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-04-19 10:53:33 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-04-19 10:53:33 +0200
commitce31184bf30fcfbc45dab480d0072e51f626b15a (patch)
treedffc75162b7add826614fe56fcb683a918185247
parentfea11d24bc7b93ef516fa52a04e32b5ae5e419de (diff)
downloadperl-software-in-gnu-guix-ce31184bf30fcfbc45dab480d0072e51f626b15a.tar
perl-software-in-gnu-guix-ce31184bf30fcfbc45dab480d0072e51f626b15a.tar.gz
split postmessage config into two options
-rw-r--r--js/reveal.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/reveal.js b/js/reveal.js
index a575956..8b7b158 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -89,9 +89,12 @@ var Reveal = (function(){
// Opens links in an iframe preview overlay
previewLinks: false,
- // Flags if we should listen to and dispatch events through window.postMessage
+ // Exposes the reveal.js API through window.postMessage
postMessage: true,
+ // Dispatches all reveal.js events to the parent window through postMessage
+ postMessageEvents: false,
+
// Focuses body when page changes visiblity to ensure keyboard shortcuts work
focusBodyOnPageVisiblityChange: true,
@@ -972,11 +975,8 @@ var Reveal = (function(){
// If we're in an iframe, post each reveal.js event to the
// parent window. Used by the notes plugin
- if( config.postMessage && window.parent !== window.self ) {
- // Remove arguments that can't be stringified (circular structures)
- if( args && args.currentSlide ) delete args.currentSlide;
- if( args && args.previousSlide ) delete args.previousSlide;
- window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, eventArgs: args || null }), '*' );
+ if( config.postMessageEvents && window.parent !== window.self ) {
+ window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' );
}
}