mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-11 00:55:01 +02:00
sync lightbox between speaker/main window (fixes #3771)
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -209,6 +209,9 @@ const Plugin = () => {
|
||||
deck.on( 'overviewshown', post );
|
||||
deck.on( 'paused', post );
|
||||
deck.on( 'resumed', post );
|
||||
deck.on( 'showmediapreview', post );
|
||||
deck.on( 'showiframepreview', post );
|
||||
deck.on( 'closeoverlay', post );
|
||||
|
||||
// Post the initial state
|
||||
post();
|
||||
|
@@ -414,14 +414,23 @@
|
||||
}
|
||||
// Messages sent by the reveal.js inside of the current slide preview
|
||||
else if( data && data.namespace === 'reveal' ) {
|
||||
const supportedEvents = [
|
||||
'slidechanged',
|
||||
'fragmentshown',
|
||||
'fragmenthidden',
|
||||
'paused',
|
||||
'resumed',
|
||||
'showiframepreview',
|
||||
'showmediapreview',
|
||||
'closeoverlay'
|
||||
];
|
||||
|
||||
if( /ready/.test( data.eventName ) ) {
|
||||
// Send a message back to notify that the handshake is complete
|
||||
window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'connected'} ), '*' );
|
||||
}
|
||||
else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
||||
|
||||
else if( supportedEvents.includes( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
||||
dispatchStateToMainWindow( data.state );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user