This module is responsible for showing 'toaster' messages to the user. For more information see, toastr
Example
// It is possible to show a toaster in a variety of ways
// Show a info message without title
App.toaster.info('This is an info message');
// Show an error message with title
App.toaster.error('This is an error message', 'This is the title');
// Show an warning message with title and with a show duration of 1 second
App.toaster.warning('This is an error message', 'This is the title', {showDuration: 1000});
// Show an success message by passing in an object
App.toaster.success({message: 'Great success!', title: 'Success!', timeout: 3000});
// **Options**
var options = {
message: 'The message',
title: 'The title',
closeButton: true,
newestOnTop: false,
progressBar: false,
positionClass: 'toast-top-right',
preventDuplicates: false,
onclick: null, // onclick callback
showDuration: 300,
hideDuration: 1000,
timeOut: 8000,
extendedTimeOut: 1000,
showEasing: 'swing',
hideEasing: 'linear',
showMethod: 'fadeIn',
hideMethod: 'fadeOut'
}
Methods
(static) error(Object/String)
Shows an error message
Parameters:
Name | Type | Description |
---|---|---|
Object/String |
Object | String | that describes what and how to display the toaster |
(static) info(What)
Shows an info message
Parameters:
Name | Type | Description |
---|---|---|
What |
Object | String | to display in the toaster and options |
(static) success(Object/String)
Shows a success message
Parameters:
Name | Type | Description |
---|---|---|
Object/String |
Object | String | that describes what and how to display the toaster |
(static) warning(Object/String)
Shows an warning message
Parameters:
Name | Type | Description |
---|---|---|
Object/String |
Object | String | that describes what and how to display the toaster |