API Docs for:
Show:

IndicatorManager Class

Manage indicator instances and make sure they're destroyed.

Methods

_addListeners

() private

Wire up our events listeners.

_destroyIndicators

() private

On destroy, run destroy on any indicator instances we have. This is a method so we can hook up and test that it's called vs a closure in the init.

_initIndicatorManager

() private

Init during class initialization. Add _indicators and catch destroy event to clean up indicator instances.

_renderUI

()

To prevent having to force call sites to pass in parentNode, we must override YUI's built-in _renderUI method.

This is a copy of the YUI method, except for using our own parentNode. This is needed so the spinner overlays correctly.

bindUI

()

Sets up event listeners.

error

()

Method called to clear overlay on error.

hideIndicator

(
  • node
)

Helper to make sure we can hide an indicator correctly.

Parameters:

  • node Node

    the container the indicator is currently over.

initializer

()

Initializer; hides the indicator on creation.

renderUI

()

Build the indicator overlay itself.

resizeAndReposition

()

Resize and reposition before we show the overlay, to ensure the overlay always matches its target's size/pos.

setBusy

()

Mark the loading or busy action as in progress, and show the overlay.

showIndicator

(
  • node
)

Show/setBusy an indicator for a given node. If an indicator is already attached then just show it, else create a new indicator instance on the node.

Parameters:

  • node Node

    the node to cover with the indicator.

success

()

Method called to clear overlay on success.

Attributes

error_action

Function

Callback to fire upon calling error.

Default: undefined

loading_image

String

Default: '/juju-ui/assets/images/loading-spinner.gif'

success_action

Function

Callback to fire upon calling success.

Default: undefined

target

Y.Node

A reference to the node that we're going to overlay.

Default: undefined