core.Module - core

#

API Docs for: 0.0.2
Show: Inherited Protected Private Deprecated

# core.Module Class

Extends core.EventDispatcher
Defined in: `src/lib/module.js:1`
Module: addons

The base object of all core based classes. Every object created within the Core framework derives from this class.

## Constructor

### `core.Module`

(

- `opts`

)

Defined in `src/lib/module.js:1`

#### Parameters:

- `opts` Object

  An object containing configurations required by the Core derived class.

  - `el` HTMLElement

    The node element included in the class composition.

- Index
- Methods
- Properties

## Item Index

### Methods

- clearProxyHandler
- construct
- containsScope
- delayedConstruct
- dispose
- find
- findAll
- getProxyHandler
- off
- on
- once
- register
- removeAll
- removeScope
- trigger
- unregister

### Properties

- node
- proxyHandlers

## Methods

### `clearProxyHandler`

(

- `method`

)

Inherited from core.Core: `src/core.js:716`

Core method for clearing proxied function methods.

#### Parameters:

- `method` String

  The string equivalent of the defined method to clear.

### `construct`

(

- `options`

)

Inherited from core.Core: `src/core.js:732`

Core method initialization. This is called automatically on core sub classes.

#### Parameters:

- `options` Object

  The object passed on the constructor of a core based class.

### `containsScope`

(

- `list`
- `scope`

)
Booleans private

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:162`

Checks the array of listeners for existing scopes.

#### Parameters:

- `list` Array

  Reference to the array of subscribed listeners

- `scope` Object

  Reference to the scope being queried for existence

#### Returns:

Booleans:

Returns boolean indicating the existence of the scope passed on the parameters

### `delayedConstruct`

(

- `options`

)

Inherited from core.Core: `src/core.js:740`

Core method initialization. This is called automatically on core sub classes. Adds delay when being called automatically, this allows time to setup all the other classes and manage the sequence of instantiations.

#### Parameters:

- `options` Object

  The object passed on the constructor of a core based class.

### `dispose`

(

- `removeNode`

)

Inherited from core.Core: `src/core.js:749`

Core method for destroying/cleaning up objects.

#### Parameters:

- `removeNode` Boolean

  If true and there is a node attached in the class (el property) that element is going to be removed upon disposal.

### `find`

(

- `selector`

)
NodeList

Inherited from core.Core: `src/core.js:770`

Core method for searching sub node elements.

#### Parameters:

- `selector` String

  The selector used for searching sub nodes.

#### Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

### `findAll`

(

- `selector`

)
NodeList

Inherited from core.Core: `src/core.js:785`

Core method for searching sub node elements within the document context.

#### Parameters:

- `selector` String

  The selector used for searching sub nodes within the document.

#### Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

### `getProxyHandler`

(

- `method`

)
Function

Inherited from core.Core: `src/core.js:695`

Returns a scope bound function and stores it on the proxyHandlers property.

#### Parameters:

- `method` String

  The string equivalent of the defined method name of the class.

#### Returns:

Function:

The scope bound function defined on the parameter.

### `off`

(

- `eventName`
- `method`
- `scope`

)

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:60`

Unsubscribe function. Called when removing a subscriber from the broadcasting object.

#### Parameters:

- `eventName` String

  The event name unsubscribing from.

- `method` Function

  The method handler to trigger when the event specified is dispatched.

- `scope` core.Core

  Reference to the scope of the event handler

### `on`

(

- `eventName`
- `method`
- `scope`

)

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:24`

Subscribe function. Called when adding a subscriber to the broadcasting object.

#### Parameters:

- `eventName` String

  The event name being subscribed to

- `method` Function

  The method handler to trigger when the event specified is dispatched.

- `scope` core.Core

  Reference to the scope of the event handler

### `once`

(

- `eventName`
- `method`
- `scope`

)

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:45`

Subscribe once function. Called when adding a subscriber to the broadcasting object.

#### Parameters:

- `eventName` String

  The event name being subscribed to

- `method` Function

  The method handler to trigger when the event specified is dispatched.

- `scope` core.Core

  Reference to the scope of the event handler

### `register`

(

- `eventName`
- `scope`
- `method`
- `once`

)
private

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:182`

Private method handler for event registration.

#### Parameters:

- `eventName` String

  The event name being added on the listener list.

- `scope` Object

  Reference to the scope of the event handler

- `method` Function

  The method used by the scope to handle the event being broadcasted

- `once` Boolean

  Specify whether the event should only be handled once by the scope and its event handler

### `removeAll`

()

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:100`

Removes all items from the listener list.

### `removeScope`

(

- `scope`

)

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:73`

Unsubscribe function - scope context. Unsubscribes a specific scope from ALL events

#### Parameters:

- `scope` core.Core

  Reference to the scope subscriber being removed.

### `trigger`

(

- `eventName`
- `variables`

)

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:125`

Broadcast functions. Triggers a broadcast on the EventDispatcher/derived object.

#### Parameters:

- `eventName` String

  The event name to trigger/broadcast.

- `variables` Object

  An object to send upon broadcast

### `unregister`

(

- `eventName`
- `scope`
- `method`
- `once`

)
private

Inherited from core.EventDispatcher: `src/lib/eventdispatcher.js:236`

Private method handler for unregistering events

#### Parameters:

- `eventName` String

  The event name being added on the listener list.

- `scope` Object

  Reference to the scope of the event handler

- `method` Function

  The method used by the scope to handle the event being broadcasted

- `once` Boolean

  Specify whether the event should only be handled once by the scope and its event handler

## Properties

### `node`

HTMLElement

Inherited from core.Core: `src/core.js:641`

The selected HTML element node reference.

### `proxyHandlers`

Object

Inherited from core.Core: `src/core.js:658`

Property for storing proxied function/methods