Manage the AskiaPortal notification bar.
portal.notification.show({
message : "Hello world!"
});
Dependencies:
- ./js/portal.channel.js
Methods
(static) hide() → {Promise}
Hide the AskiaPortal notification bar.
Returns:
- Type
- Promise
(static) show(options) → {Promise}
Display the AskiaPortal notification bar.
Except for the error
message, the notification will automatically disappear after 7 seconds.
// Neutral message
portal.notification.show({
message : "A neutral message"
});
// Success message
portal.notification.show({
message : "A success message",
status: "success"
});
// Warning message
portal.notification.show({
message : "A warning message",
status: "warning"
});
// Error message
portal.notification.show({
message : "An error message",
status: "error"
});
// Peristent message with details
portal.notification.show({
message : "A persistent message with details",
more: {
text: "Details...",
title: "Click here to get more details"
},
timeout: 0
}).then(() => {
console.log("The user has clicked on `More`");
portal.notification.hide();
});
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
- Type
- Promise