API Docs for: 2.1.0
Show:

Tc.Sandbox Class

Defined in: dist/terrific.js:531
Module: Tc

The sandbox is used as a central point to get resources from, grant permissions, etc. It is shared between all modules.

Methods

addCallback

(
  • phase
  • callback
)

Adds a callback to be executed in the appropriate phase.

Parameters:

  • phase String

    default: end

  • callback Function

addModules

(
  • $ctx
)
Array

Adds (register and start) all modules in the given context scope.

Parameters:

  • $ctx JQuery

    The jQuery context

Returns:

Array:

A list containing the references of the registered modules

getConfig

() Object

Gets the application config.

Returns:

Object:

The configuration object

getConfigParam

(
  • name
)
Mixed

Gets an application config param.

Parameters:

  • name String

    The param name

Returns:

Mixed:

The appropriate configuration param

getModuleById

(
  • id
)
Module

Gets the appropriate module for the given ID.

Parameters:

  • id Int

    The module ID

Returns:

Module:

The appropriate module

init

(
  • application
  • config
)

Initializes the Sandbox.

Parameters:

  • application Applicaton

    The application reference

  • config Object

    The configuration

ready

(
  • callback
)

Collects the module status messages and handles the callbacks. This means that it is ready for the 'after' hook.

Parameters:

  • callback Function

    The 'after' hook module callback

removeModules

(
  • modules
)

Removes a module by module instances. This stops and unregisters a module through a module instance.

Parameters:

  • modules Mixed

    A list containing the module instances to remove or the jQuery context to look for registered modules in.

subscribe

(
  • connector
  • module
)

Subscribes a module to a connector.

Parameters:

  • connector String

    The full connector name (e.g. MasterSlave-Navigation)

  • module Module

    The module instance

unsubscribe

(
  • connectorId
  • module
)

Unsubscribes a module from a connector.

Parameters:

  • connectorId String

    The connector channel id (e.g. 2 or Navigation)

  • module Module

    The module instance

Properties

application

Application

The application

config

Object

The configuration.

hooks

Object

Contains function references to registered hooks.