Documentation

Powered by Minitek FAQ Book

Methods

A Polipop instance has the following public methods:


getOption(key)

Retrieves the value of a property within the configuration options object. Accepts the argument:

  • {String} key - The property or method name.

For example:

var theme = polipop.getOption('theme');

setOption(key, value)

Sets the value of a property within the configuration options object. Accepts the arguments:

  • {String} key - The property or method name.
  • {String|Number|Boolean|Function} value - The property or method value.

For example:

polipop.setOption('pool', 5);

add(notification)

Adds a notification object to the queue. Accepts the argument:

  • {Object} notification - A notification object.

    The notification object has the following properties:

    • type - The notification type.

      Type: {String}

      Accepted values: default, info, success, warning or error.

    • title - The notification title.

      Type: {String}

    • content - The notification content.

      Type: {String}


For example:

polipop.add({
  type: 'success',
  title: 'Message',
  content: 'This is the message content.'
});

enable()

Enables adding notification objects to the queue.

polipop.enable();

disable()

Disables adding notification objects to the queue.

polipop.disable();

pause()

Pauses the rendering and the expiration of notification elements.

polipop.pause();

unpause()

Unpauses the rendering and the expiration of notification elements.

polipop.unpause();

closeAll()

Removes all rendered notification elements from the DOM.

polipop.closeAll();

emptyQueue()

Deletes all notification objects from the queue.

polipop.emptyQueue();

destroy()

Removes the wrapper element from the DOM and stops the main loop that starts in the _init function.

polipop.destroy();
Was this helpful?
Loading...
3