Notify
Singleton toast notifications for warning, success and info messages, shown in a screen corner and closed automatically
Configuration:
timeout {Number}has to contain a timeout (milliseconds) for the expiration of notification (default:3000)position {String}can betop,top left,top right(default),bottom,bottom leftandbottom right
Methods:
SETTER('notify/warning', 'Some warning');
SETTER('notify/success', 'Some success message');
SETTER('notify/info', 'Some info message');Works with ASETTER:
- errors are handled automatically
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully'));
// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully', function(response) {
console.log(response);
}));
// Or with a callback and without notify
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', function(response) {
console.log(response);
}));
// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Your message', '?.response'));



