new Message(messageElement, options)

Class constructor.

parameter type default description
messageElement (optional) HTMLElement The message element in the DOM
options (optional) Object {} An options object for configuring the message

Methods

Links

module.exports.message

Static Method

Build a full message element. Used when there is no message element in the DOM.

Returns

  • HTMLElement - Returns the new message element

Links

module.exports.closeButton

Static Method

Build a close button

Returns

  • HTMLElement - Returns a new element to close the message

Links

Message#render

Instance Method

Render the message.

Links

Message#open

Instance Method

Open the message.

Links

Message#close

Instance Method

Close the message.

Links

Message.getDataAttributes(messageElement)

Static Method

Get the data attributes from the messageElement. If the message is being set up declaratively, this method is used to extract the data attributes from the DOM.

parameter type default description
messageElement HTMLElement The message element in the DOM

Links

Message.init(rootElement, options)

Static Method

Initialise message component.

parameter type default description
rootElement HTMLElement | String The root element to intialise a message in, or a CSS selector for the root element
options (optional) Object {} An options object for configuring the banners

Links