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

NameTypeDefaultDescription
idstringId of the windowless glass to remove.
options.animatebooleantrueWhether 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