API reference / Common / OverlayManager
Class: OverlayManager
Reconciles the registered OverlaySources against a container element each painted frame: creates newly-appeared items, repositions and refreshes the rest, and removes items whose key vanished (a page scrolled off). Sources render in registration order, which is also their stacking order (later sources paint above earlier ones). Positioning is a single transform per item — the cheap path the browser can keep on the compositor.
Constructors
Constructor
new OverlayManager(container): OverlayManager;Parameters
| Parameter | Type |
|---|---|
container | HTMLElement |
Methods
set()
set(id, source): void;Register (or replace) the overlay under id. Re-renders immediately against the last frame's pages, so an overlay set after the document is already on screen shows up without waiting for the next paint. Ids prefixed udoc: are the built-ins — replace or remove them to take over a built-in overlay.
Parameters
| Parameter | Type |
|---|---|
id | string |
source | OverlaySource |
remove()
remove(id): boolean;Remove the overlay under id (and its elements). False if unknown.
Parameters
| Parameter | Type |
|---|---|
id | string |
render()
render(frame): void;Reconcile the overlay DOM against one painted frame.
Parameters
| Parameter | Type |
|---|---|
frame | OverlayFrame |
clear()
clear(): void;Remove every overlay element and registration (document close/teardown).