Show:

Q.Masks Class

Methods for temporarily covering up certain parts of the screen with masks

Item Index

Methods

Methods

globalNamesAdded

() static

This function is useful to make sure your code is not polluting the global namespace

hide

(
  • key
)
static

Hides the mask by given key. If mask with given key doesn't exist, fails silently.

Parameters:

  • key String

    A key of the mask to hide

isVisible

(
  • key
)
static

Checks if a mask with given key has been created and is currently being shown.

Parameters:

  • key String

    The key of the mask

mask

(
  • key
  • [options={}]
)
Object static

Creates new mask with given key and options, or returns already created one for that key.

Parameters:

  • key String

    A string key to identify mask in subsequent Q.Masks calls.

  • [options={}] Object optional

    The defaults are taken from Q.Masks.options[key]

    • [className=''] String optional

      CSS class name for the mask to style it properly.

    • [fadeIn=0] Number optional

      Milliseconds it should take to fade in the mask

    • [fadeOut=0] Number optional

      Milliseconds it should take to fade out the mask.

    • [duration] Number optional

      If set, hide the mask after this many milliseconds.

    • [zIndex] Number optional

      You can override the mask's default z-index here

    • [html=''] String optional

      Any HTML to insert into the mask.

    • [shouldCover=null] HTMLElement optional

      Optional element in the DOM to cover.

Returns:

Object:

the mask info

noConflict

(
  • extend
)
Function

This method restores the old window.Q and returns an instance of itself.

Parameters:

  • extend Boolean

    If true, extends the old Q with methods and properties from the Q Platform. Otherwise, the old Q is untouched.

Returns:

Function:

Returns the Q instance on which this method was called

show

(
  • key
  • [options={}]
)
Object static

Shows the mask by given key. Only one mask is shown for any given key. A counter is incremented on Masks.show and decremented on Masks.hide, causing the mask to be hidden when the counter reaches zero. If a mask with the given key doesn't exist, Mask.create is automatically called with the key and options from Q.Masks.options[key] .

Parameters:

  • key String

    The key of the mask to show.

  • [options={}] Object optional

    Used to provide any mask options to Q.Masks.mask

Returns:

Object:

the mask info

stackTrack

() static

This function is useful for debugging, e.g. calling it in breakpoint conditions

update

() static

Updates size and appearance of all the masks. Automatically called on Q.onLayout