Namespace: notification

notification

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

notification message to send to AskiaPortal

Properties
Name Type Attributes Default Description
message String

Message to display in the notification bar

status String | "success" | "warning" | "error" <optional>

Status of the notification.

more Object <optional>

Activate the more action link

Properties
Name Type Attributes Description
text String <optional>

Message on the more action link

title String <optional>

Title on the more action link

timeout Number <optional>
7000

Timeout before to close the notification (7s by default for non-error).

position String | "top" | "frame" <optional>
"frame"

Position of the notification (Use "top" to cover the toolbar of AskiaPortal)

Returns:
Type
Promise