Alertpal
Methods
(static) alert(detailsopt)
Function to configure and display the 'alert' style Alertpal
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
details |
object | <optional> |
Object to define the configuration of the alert (Optional - details of defaults below) Properties
|
Example
const config = {
title: 'New alert',
description: 'This is a alert pop up',
cancel: 'Go back',
cancelCallback: returnToPage
};
Alertpal.alert(config);
(static) confirm(details)
Function to configure and display the 'confirm' style Alertpal
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
details |
object |
Object to define the configuration of the confirm Properties
|
- Source:
Example
const config = {
title: 'Delete Item',
description: 'Are you sure you want to delete this item?',
cancel: 'No',
ok: 'Yes',
okCallback: deleteItemFunction
};
Alertpal.confirm(config);
(static) message(typeopt, detailsopt)
Function to configure and display the 'message' style Alertpals
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
string | <optional> |
Define what type of message 'normal' / 'success' / 'warn' / 'error' (Optional - default is 'normal') |
||||||||||||||||
details |
object | <optional> |
Object to define the configuration of the alert (Optional - details of defaults below) Properties
|
- Source:
Example
const config = {
message: 'Warning, you cant do that!',
timeout: 10000
};
Alertpal.message('warn', config);
(static) modal(detailsopt)
Function to configure and display the 'alert' style Alertpal
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
details |
object | <optional> |
Object to define the configuration of the alert (Optional - details of defaults below) Properties
|
Example
const config = {
title: 'Read the rules of the Application',
description: 'Rules...',
cancel: 'Decline',
ok: 'Accept',
okCallback: acceptFunction
};
Alertpal.modal(config);