Windowless glass
Example
Click the button to open a modal windowless glass. It floats on document.body, so no window needs to be mounted. Click the backdrop or the close action to dismiss it. See addWindowlessGlass for all options. The example below is hosted within an iframe. You can also view it here.
<button id="open-glass">Open dialog</button>
import { BinaryWindow } from 'bwin';
document.getElementById('open-glass').addEventListener('click', () => {
BinaryWindow.addWindowlessGlass({
modal: true,
closeOnBackdropClick: true,
width: 240,
height: 140,
title: 'Dialog',
content: 'Click the backdrop or the close action to dismiss.',
});
});
addWindowlessGlass and removeWindowlessGlass are static methods, so call them on the BinaryWindow class directly.