new App()
Core app class firing two events as the site loads. An init
event id fired on document.DOMContentLoaded and a load
event is fired on window.load
- Since:
- 1.0.0
- Source:
Fires:
Extends
Members
events :Object
Object storing all event types.
Each event type is an array of callback functions that get executed when an event of that type of dispatched.
Type:
- Object
- Inherited From:
- Source:
title :string
The application's name/title, which will originally pulls from the browser's title
Type:
- string
- Default Value:
- document.title
- Source:
Methods
addEventListener(eventType, callback) → {void}
Attaches an event handler to a specific event type
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | The type of the event you'd like to listen for |
callback |
function | The function to be executed when the event occurs |
- Inherited From:
- Source:
Returns:
- Type
- void
dispatchEvent(eventType, eventObj) → {void}
Fires an event on behalf of the object
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | The type of the event you'd like to fire |
eventObj |
Event | The actual event object that will be passed to listener functions. This can be used to store additional information for the situation. |
- Inherited From:
- Source:
Returns:
- Type
- void
removeEventListener(eventType, callback) → {void}
Removes a previously attached event to a specific event type.
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | The type of the event you'd like to unbind a handler for |
callback |
function | This must be a reference to the same Function object that has been set as a listener. Otherwise the removal will not take place. |
- Inherited From:
- Source:
Returns:
- Type
- void
Events
init
Alias for the document
's DOMContentLoaded
event
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
originalEvent |
Event | The actual DOMContentLoaded event |
currentTarget |
Object | The App instance triggering the event |
- Source:
load
Alias for window.load
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
originalEvent |
Event | The actual DOMContentLoaded event |
currentTarget |
Object | The App instance triggering the event |
- Source: