Notification
LxNotificationService
is a service that manage notifications, alert boxes and confirm boxes.
The notify
method have four parameters that allow user to prepend a colored icon and to handle with sticky notifications.
Helper methods quickly create styled notification: info
, success
, warning
, error
.
The alert
method create an alert box with a title, a text and handle user action in a callback.
The confirm
method create a confirm box with a title, a text and handle user action in a callback.
Parameter |
Type |
Default |
Description |
text* |
string |
|
The notification text. |
icon |
string |
|
The icon identifier. |
sticky |
boolean |
false |
Specify if the notification is sticky. |
color |
string |
white |
Define the icon color. Options: colors defined in colors and sizes section in dist/scss/core/settings/defaults.scss |
Parameter |
Type |
Description |
text* |
string |
The notification text. |
Parameter |
Type |
Description |
text* |
string |
The notification text. |
Parameter |
Type |
Description |
text* |
string |
The notification text. |
Parameter |
Type |
Description |
text* |
string |
The notification text. |
Parameter |
Type |
Default |
Description |
title* |
string |
|
The alert box title. |
text |
string |
|
The alert box text. |
button |
string |
|
The alert box button label. |
callback |
function |
|
The alert box callback with the answer as available parameter (always true for the alert box). |
unbind |
boolean |
false |
Unbind the escape key to close the alert box. |
Parameter |
Type |
Default |
Description |
title* |
string |
|
The confirm box title. |
text |
string |
|
The confirm box text. |
buttons |
object |
|
The confirm box buttons label. { cancel: 'Disagree', ok: 'Agree' } |
callback |
function |
|
The confirm box callback with the answer as available parameter. |
unbind |
boolean |
false |
Unbind the escape key to close the confirm box. |