Module: deliteful/ToasterMessage

deliteful/ToasterMessage

require(["deliteful/ToasterMessage"], function (ToasterMessage) {
  new ToasterMessage();
});

ToasterMessage widget.

This class is not meant to be used alone. It needs to be combined with deliteful/Toaster.

Source:
Example
var toaster = new Toaster();
var message = new ToasterMessage({message: "hello, world!"});
toaster.postMessage(message);

Extends

  • delite/Widget
Show inherited

Members

<static> dismissible :string

Indicates whether the message can be dismissed. Is one of ["on", "off", "auto"]. If "auto", isDismissible adopts a default behaviour that depends on duration.

Type:
  • string
Default Value:
  • null
Source:

<static> duration :number

Duration which specifies how long the message is shown. If set to a strictly negative value, the message is shown persistently until it is dismissed.

Type:
  • number
Default Value:
  • 2000
Source:

<static> message :string

Content of the message.

Type:
  • string
Default Value:
  • null
Source:

<static> messageTypeClass :string

A string containing the class that matches the type of the message.

Type:
  • string
Default Value:
  • null
Source:

<static> type :string

Type of the message. type is one of ["info", "success", "warning", "error"].

Type:
  • string
Default Value:
  • "info"
Source:

Methods

<static> dismiss(animation)

Dismisses the message, optionally with an animation.

Parameters:
Name Type Argument Description
animation string <optional>

an animation class that will be added to dismiss the message

Source:

<static> isDismissible() → {boolean}

Returns whether the message can be dismissed.

If the dismissible property was set to "on" (respectively "off"), this method returns true (respectively false). If dismissible was set to "auto", this method returns false if the message is expirable, true otherwise.

Source:
Returns:
Type
boolean

<static> isExpirable() → {boolean}

Returns whether the message can expire. The default implementation returns true if duration is larger or equal than 0.

Source:
Returns:
Type
boolean