NotificationCenter (extends KompElement)
Render message on the top layer.
Example
Syntax
new NotificationCenter().add('Success!')
Options
animation
types | description | default | |
---|---|---|---|
content
|
String, HTMLElement, Array, Object |
content for the notification, uses Dolla's |
|
timeout
|
Boolean or Object |
true/false to animate or not, pass object to animate with options for |
5000 |
Methods
arguments | description | return | |
---|---|---|---|
intialize
|
[] |
method called once for each instantiation, but only after element is connected (required for accessing some properties) |
|
trigger
|
eventName:string, ...args |
triggers an event this element passes args |
|
addEventListenerFor
|
element:HTMLElement, eventType:string, ...args |
calls callback when eventType is triggered on element, enables component to tear down listener when disconnected. |
|
changed
|
attribute, was, now |
called every time an attribute of the element changes. Must include attribute in |
|
[attribute]Changed
|
was, now |
called every time |
|
add
|
content:DollaContent, options:Object |
content to add to notification center, uses Dolla's |
Notification |
Events
arguments | description | |
---|---|---|
beforeRemove
|
[] |
called before element is removed |
afterRemove
|
[] |
called after element is removed |
beforeConnect
|
[] |
called before element is connected |
afterConnect
|
[] |
called before element is connected |
beforeDisconnect
|
[] |
called before element is disconnected |
afterDisconnect
|
[] |
called before element is disconnected |
shown
|
when notification is shown |
|
hidden
|
when notification is hidden |
Transition Animation
The notification will follow the transition effects set by CSS, and adds classes -out
, -out-start
, -in
and -in-start
when hiding and showing.