Skip to content

Commit

Permalink
dispatch event when showing lightbox or help overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Feb 20, 2025
1 parent fe67bad commit 2059d38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/controllers/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class Overlay {
this.viewport.classList.add( 'r-overlay-viewport' );

this.dom.appendChild( this.viewport );
this.Reveal.getViewportElement().appendChild( this.dom );
this.Reveal.getRevealElement().appendChild( this.dom );

}

Expand Down Expand Up @@ -91,6 +91,8 @@ export default class Overlay {
this.close();
}, false );

this.Reveal.dispatchEvent({ type: 'showiframepreview', data: { url } });

}

/**
Expand Down Expand Up @@ -178,6 +180,8 @@ export default class Overlay {
event.preventDefault();
}, false );

this.Reveal.dispatchEvent({ type: 'showmediapreview', data: { mediaType, url, trigger } });

}

/**
Expand Down Expand Up @@ -246,6 +250,8 @@ export default class Overlay {
event.preventDefault();
}, false );

this.Reveal.dispatchEvent({ type: 'showhelp' });

}

}
Expand Down

0 comments on commit 2059d38

Please sign in to comment.