Skip to content

Commit ce31184

Browse files
committed
split postmessage config into two options
1 parent fea11d2 commit ce31184

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

js/reveal.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ var Reveal = (function(){
8989
// Opens links in an iframe preview overlay
9090
previewLinks: false,
9191

92-
// Flags if we should listen to and dispatch events through window.postMessage
92+
// Exposes the reveal.js API through window.postMessage
9393
postMessage: true,
9494

95+
// Dispatches all reveal.js events to the parent window through postMessage
96+
postMessageEvents: false,
97+
9598
// Focuses body when page changes visiblity to ensure keyboard shortcuts work
9699
focusBodyOnPageVisiblityChange: true,
97100

@@ -972,11 +975,8 @@ var Reveal = (function(){
972975

973976
// If we're in an iframe, post each reveal.js event to the
974977
// parent window. Used by the notes plugin
975-
if( config.postMessage && window.parent !== window.self ) {
976-
// Remove arguments that can't be stringified (circular structures)
977-
if( args && args.currentSlide ) delete args.currentSlide;
978-
if( args && args.previousSlide ) delete args.previousSlide;
979-
window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, eventArgs: args || null }), '*' );
978+
if( config.postMessageEvents && window.parent !== window.self ) {
979+
window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' );
980980
}
981981

982982
}

0 commit comments

Comments
 (0)