Class: Namespace

conbo.Namespace(options)

new Namespace(options)

Conbo namespaces enable you to create modular, encapsulated code, similar to how you might use packages in languages like Java or ActionScript. By default, namespaces will automatically call initDom() when the HTML page has finished loading.
Parameters:
Name Type Description
options Object Object containing initialisation options
Author:
  • Neil Rackett
Source:

Extends

Members

supro

Similar to `super` in ActionScript or Java, this property enables you to access properties and methods of the super class prototype, which is the case of JavaScript is the next prototype up the chain
Inherited From:
Source:

Methods

bindAll(…methodNameopt) → {this}

Scope all methods of this class instance to this class instance
Parameters:
Name Type Attributes Description
methodName string <optional>
<repeatable>
Specific method names to bind (all will be bound if none specified)
Inherited From:
Source:
Returns:
Type
this

declarations() → {void}

Declarations is used to declare instance properties used by this class
Parameters:
Type Attributes Description
* <repeatable>
Inherited From:
Source:
Returns:
Type
void

destroy() → {void}

Clean everything up ready for garbage collection (you should override in your own classes)
Inherited From:
Source:
Returns:
Type
void

import(obj) → {conbo.Namespace}

Add classes, properties or methods to the namespace. Using this method will not overwrite existing items of the same name.
Parameters:
Name Type Description
obj Object An object containing items to add to the namespace
Source:
Returns:
This Namespace instance
Type
conbo.Namespace

initDom(rootElopt) → {this}

Search the DOM and initialize Applications contained in this namespace
Parameters:
Name Type Attributes Description
rootEl Element <optional>
The root element to initialize
Source:
Returns:
Type
this

initialize() → {void}

Initialize (entry point) is called immediately after the constructor has completed
Parameters:
Type Attributes Description
* <repeatable>
Inherited From:
Source:
Returns:
Type
void

observeDom(rootElopt) → {this}

Watch the DOM and automatically initialize Applications contained in this namespace when an element with the appropriate cb-app attribute is added.
Parameters:
Name Type Attributes Description
rootEl Element <optional>
The root element to initialize
Source:
Returns:
Type
this

preinitialize() → {void}

Preinitialize is called before any code in the constructor has been run
Parameters:
Type Attributes Description
* <repeatable>
Inherited From:
Source:
Returns:
Type
void

toString() → {string}

String representation of the current class
Inherited From:
Source:
Returns:
Type
string

unobserveDom(rootElopt) → {this}

Stop watching the DOM for Applications
Parameters:
Name Type Attributes Description
rootEl Element <optional>
The root element to initialize
Source:
Returns:
Type
this