Edit this page

up.Layer up.Layer.prototype.accept([value], [options])
Class method

Closes this overlay with an accepting intent, e.g. when a change was confirmed or when a value was selected.

To dismiss a layer without an accepting intent, use up.Layer#dismiss() instead.

Parameters

[value] any optional

The acceptance value that will be passed to { onAccepted } callbacks.

If there isn't an acceptance value, omit this argument. If you need to pass options without an acceptance value, pass null:

up.layer.accept(null, { animation: 'move-to-bottom' })
[options.confirm] string optional

A message the user needs to confirm before the overlay is closed.

[options.response] up.Response optional experimental

The server response that caused this overlay to close.

May be left blank if the overlay was not closed in reaction to a server response.

[options.animation] stringorFunction(Element, Object) optional

The animation to use for closing this layer.

Defaults to the close animation configured for this layer mode.

[options.duration] number optional

The duration for the close animation in milliseconds.

[options.easing] number optional

The timing function that controls the acceleration of the close animation.

[options.onFinished] Function optional

A callback that will run when the elements have been removed from the DOM.

If the layer has a close animation, the callback will run after the animation has finished.

Return value

A promise that fulfills when the overlay has been accepted and its parent layer has become current.

When the promise fulfills the accepted overlay may still be playing its close animation. To run code after the animation has concluded, use { onFinished }.

This website uses cookies to improve usability and analyze traffic.
I accept or learn more