-
-
Notifications
You must be signed in to change notification settings - Fork 486
Components
Web Components is a suite of different technologies allowing you to create reusable custom elements — with their functionality encapsulated away from the rest of your code — and utilize them in your web apps.
A frontend only component. It shows the user messages in the bottom right.
The notifier can be used on a page by instantiating the javascript class on the notification element available on most pages in the app.
Example:
const notificationsElement = $('#notifications')
const notifier = notificationsElement.length ? new Notifier(notificationsElement) : null
notify (message, level, isDismissable)
message
- The message to be displayed to the user
level
- info
for a green notification, warn
for an orange notification, error
for a red notification
isDismissable
(optional) - true
(default) provides a button for the user to delete the notification. false
to not provide the button.
Returns a Notification object
totalNotificationCount ()
Returns the total number of notifications shown. Only notifications created by notify
are counted.
waitForAsyncOperation ()
Adds one to the notifier's count of async operations waiting to be resolved. While the count is greater than 0, the below saving notification is shown
resolveAsyncOperation (errorMsg)
A frontend only component. A child component of the notifier. It represents a single notification generated by the notifier.
A backend only component.