Class: Toast

Toast()

new Toast()

Wrapper for one global Toast

Source:

Methods

hide()

Hide the Toast if it's visible.

Source:

show(msg, optionsopt)

Show a message with the given class in a toast.

Parameters:
Name Type Attributes Description
msg string

Message to show in the toast

options Object | string <optional>

If a string (deprecated) CSS class to add to the element If an object, more options for the notification see mw.notification.show. For backwards compatibility reasons if a string is given it will be treated as options.type

Source:

showOnPageReload(content, optionsopt)

Save the toast data in storage so that we can show it on page reload. Also check whether there is a pending message that's not shown yet. If yes, output a warning message and discard this message. This is to ensure that the page needs to be reloaded before adding a new message for showing later.

Parameters:
Name Type Attributes Description
content string

Content to be placed in element

options Object | string <optional>

If a string (deprecated) CSS class to add to the element If an object, more options for the notification see mw.notification.show. For backwards compatibility reasons if a string is given it will be treated as options.type

Source: