ConfirmDialog

com.alecdorrington.laminarcomponents.ConfirmDialog
object ConfirmDialog

The page's one confirmation dialog, drawn by a single host at the root so that no ancestor of the asking control can clip it. Cancelling is the default.

Drawn as .lc-confirm-dialog over a .lc-confirm-backdrop, its question a .lc-confirm-subject over a .lc-confirm-consequence, and its buttons .lc-confirm-buttons in .lc-confirm-actions: .lc-confirm-cancel, and each answer .lc-confirm-answer, or .lc-confirm-danger if it destroys.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Answer(caption: String, act: () => Unit, danger: Boolean = ...)

An answer a question offers besides cancelling.

An answer a question offers besides cancelling.

Value parameters

act

What answering so does.

caption

The answer's button.

danger

Whether the answer destroys something, which its button shows.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Confirmation(question: String, consequence: String, verb: String)

A question asked before something is done that cannot be undone, such as deleting it for good.

A question asked before something is done that cannot be undone, such as deleting it for good.

Value parameters

consequence

What answering yes does, as "It cannot be brought back.".

question

The question, as "Delete the report?".

verb

The button answering yes, as "Delete".

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def ask(confirmation: Confirmation, confirmed: () => Unit): Unit

Asks a question, running the action only if it is confirmed.

Asks a question, running the action only if it is confirmed.

Value parameters

confirmation

The question.

confirmed

The action.

Attributes

def choose(subject: String, consequence: String, choices: List[Answer], cancelled: () => Unit = ...): Unit

Asks a question, running the answer taken, or cancelled.

Asks a question, running the answer taken, or cancelled.

Value parameters

cancelled

What cancelling does.

choices

The answers offered besides cancelling.

consequence

What follows from answering it.

subject

The question.

Attributes

def host(active: Signal[Boolean], cancel: String): L.HtmlElement

Renders the dialog's host, mounted once at the root.

Renders the dialog's host, mounted once at the root.

Value parameters

active

Whether questions may be shown. An open question is withdrawn when it turns false, so that none outlives, say, the session it was asked in.

cancel

The button cancelling, as "Cancel".

Attributes

Returns

The host.