springroll.ApplicationOptions Class
Manage the Application options
Constructor
springroll.ApplicationOptions
()
add
(
-
prop
-
[value=null]
-
[readOnly=false]
)
PropertyDispatcher
Add a new property to allow deteching
Returns:
PropertyDispatcher:
The instance for chaining
asDOMElement
Convert a string into a DOM Element
Parameters:
-
name
String
The property name to fetch
destroy
()
Clean-up all references, don't use after this
get
Mixed
private
Generic setter for an option
Returns:
Mixed:
The value of the option
has
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
()
Initialize the values in the options
off
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.
respond
PropertyDispatcher
Whenever a property is get a responder is called
Returns:
PropertyDispatcher:
The instance for chaining
set
private
Generic setter for an option
Parameters:
-
prop
String
The property name
-
value
Mixed
The value to set
trigger
Dispatch an event
type
String
private
Return type of the value.
_destroyed
Boolean
protected
If the dispatcher is destroyed
_listeners
Object
private
The collection of listeners
_properties
Object
private
The map of property values to store
destroyed
Boolean
If the dispatcher is destroyed
getQueryString
Object
private
Get the query string as an object