springroll.ApplicationOptions Class

Manage the Application options

Constructor

springroll.ApplicationOptions

()

add

(
  • prop
  • [value=null]
  • [readOnly=false]
)
PropertyDispatcher
Add a new property to allow deteching

Parameters:

  • prop String
    The property name
  • [value=null] Mixed optional
    The default value
  • [readOnly=false] Boolean optional
    If the property is readonly

Returns:

PropertyDispatcher: The instance for chaining

asDOMElement

(
  • name
)

Defined in asDOMElement:112

Convert a string into a DOM Element

Parameters:

  • name String

    The property name to fetch

destroy

()

Inherited from springroll.EventDispatcher but overwritten in destroy:133

Clean-up all references, don't use after this

get

(
  • prop
)
Mixed
private
Generic setter for an option

Parameters:

Returns:

Mixed: The value of the option

has

(
  • name
  • [callback]
)
Boolean
Checks if the EventDispatcher has a specific listener or any listener for a given event.

Parameters:

  • name String
    The name of the single event type to check for
  • [callback] Function optional
    The listener function to check for. If omitted, checks for any listener.

Returns:

Boolean: If the EventDispatcher has the specified listener.

init

()

Defined in init:42

Initialize the values in the options

off

(
  • name
  • callback
)
EventDispatcher
Remove the event listener

Parameters:

  • name String*
    The type of event string separated by spaces, if no name is specifed remove all listeners.
  • callback Function | Array*
    The listener function or collection of callback functions

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

on

(
  • name
  • callback
  • [priority=0]
)
EventDispatcher
Add an event listener. The parameters for the listener functions depend on the event.

Parameters:

  • name String | Object
    The type of event (can be multiple events separated by spaces), or a map of events to handlers
  • callback Function | Array*
    The callback function when event is fired or an array of callbacks.
  • [priority=0] Int optional
    The priority of the event listener. Higher numbers are handled first.

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

once

(
  • name
  • callback
  • [priority=0]
)
EventDispatcher
Add an event listener but only handle it one time.

Parameters:

  • name String | Object
    The type of event (can be multiple events separated by spaces), or a map of events to handlers
  • callback Function | Array*
    The callback function when event is fired or an array of callbacks.
  • [priority=0] Int optional
    The priority of the event listener. Higher numbers are handled first.

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

override

(
  • name
  • value
)
springroll.ApplicationOptions

Defined in override:126

Override a default value

Parameters:

  • name String

    The property name to fetch

  • value

    The value

Returns:

springroll.ApplicationOptions:

Instance of this options for chaining

readOnly

(
  • prop
)
springroll.PropertyDispatcher
deprecated

Inherited from springroll.PropertyDispatcher: readOnly:71

Deprecated: since version 0.4.0

Turn on read-only for properties

Parameters:

  • prop String multiple
    The property or properties to make readonly

Returns:

springroll.PropertyDispatcher: The instance for chaining

respond

(
  • name
  • responder
)
PropertyDispatcher
Whenever a property is get a responder is called

Parameters:

  • name String
    The property name
  • responder Function
    Function to call when getting property

Returns:

PropertyDispatcher: The instance for chaining

set

(
  • prop
  • value
)
private
Generic setter for an option

Parameters:

  • prop String
    The property name
  • value Mixed
    The value to set

trigger

(
  • type
  • arguments
)
Dispatch an event

Parameters:

  • type String
    The type of event to trigger
  • arguments
    Additional parameters for the listener functions.

type

(
  • value
)
String
private
Return type of the value.

Parameters:

  • value

Returns:

String: The type

_app

springroll.Application private

Defined in _app:31

Reference to the application

_destroyed

Boolean protected
If the dispatcher is destroyed

_listeners

Object private
The collection of listeners

_options

Object private

Defined in _options:23

The user input options

_properties

Object private
The map of property values to store

destroyed

Boolean
If the dispatcher is destroyed

getQueryString

Object private

Defined in getQueryString:77

Get the query string as an object