Use the Alert
module to show alerts. Great for sticky alert banners, sometimes called "toasters".
-
Required Attributes
data-alert-id
: unique identifier for the alert, e.g. "megacorp-cookie-notification"
data-alert-timestamp
: the Unix time representation of when the alert was published/last updated
-
Debugging:
Alert.resetAlert($element)
: reset the visibility of a particular alert element
Alert.resetAllAlerts()
: do the same for all alerts
- Viewing the page in an Incognito window works as well.