[up-accept]
HTML attribute
Accepts the current layer when this element is clicked or submitted.
On a button
To accept the current layer when a button is clicked, use an [up-accept] attribute:
<button up-accept>Close overlay</button>
This button will accept the overlay with the value { id: 5 }:
<button up-accept="{ id: 5 }">Choose user #5</button>
See Closing when a button is clicked.
On a hyperlink
When reusing a page within an overlay, the same link may need to close the overlay, but navigate somewhere else when the page is shown on the root layer.
In this case, use a hyperlink (<a>) with a fallback URL in its [href] attribute:
<a href="/list" up-accept>Finish</a>
Unpoly will only navigate to /list when this link is clicked in the root layer.
In an overlay, the click event is prevented and the overlay is accepted.
See Closing when a link is followed.
On a form
To accept an overlay when a form is submitted, set an [up-accept] attribute on the <form> element.
This will immediately accept the overlay upon submission, without making a network request:
<form up-accept> <!-- mark: up-accept -->
...
</form>
The form's field values will become the acceptance value of the closed overlay
as an up.Params value.
Modifying attributes
Acceptance
On buttons and links, the overlay's acceptance value as a relaxed JSON string.
If the attribute value is omitted, a value null will be used.
A message the user needs to confirm before the layer is closed.
See Confirmation dialogs: Confirming before closing an overlay.
Animation
The name of the closing animation.
The duration of the closing animation in milliseconds.
The timing function that controls the closing animation's acceleration.