Edit this page

up.layer up:layer:accept
DOM event

This event is emitted before a layer is accepted.

The event is emitted on the element of the layer that is about to close.

Closing overlays


Event properties

event.layer
required

The layer that is about to close.

[event.value]
optional

The overlay's acceptance value.

Listeners may replace or mutate this value.

any
[event.origin]
optional

The element that is causing the layer to close.

Will be undefined if the overlay is not closing by a user interacting with an element.

[event.response]
optional

The server response that is causing this overlay to close.

Will be undefined if the overlay is not closing in reaction to a server response.

See Using the discarded response.

event.preventDefault()
required

Prevents the overlay from closing.