removeWindowlessGlass
Description
Remove a windowless glass by its id. This is a static method on
BinaryWindow. Removing an already-removed glass (for example one closed via its
own close action) is a no-op, so a stale id is harmless.
BinaryWindow.removeWindowlessGlass(id, options);
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
id | string | — | Id of the windowless glass to remove. |
options.animate | boolean | true | Whether to play the close animation. Pass false to remove immediately. |
Returns
Type: Promise<Element | null>
Description: Resolves to the removed glass element, or null if no glass with
that id existed.
Examples
const glassEl = await BinaryWindow.addWindowlessGlass({ title: 'Dialog' });
// later
BinaryWindow.removeWindowlessGlass(glassEl.id);
// remove immediately, without the close animation
BinaryWindow.removeWindowlessGlass(glassEl.id, { animate: false });
See also
- Windowless glass — the concept
- addWindowlessGlass