API Docs for:
Show:

Module Class

Defined in: module.js:34
Module: module-manager

Code Sample:

var module = new Y.Module({
    selector: "#foo"
});
module.on("viewload", function (e) {
    _node = this.get("node");
});
module.broadcast();
module.listen();

Methods

_log

() private

Defined in module.js:22

A convenient alias method for Y.log(, "info", "Y.Module");

broadcast

(
  • name
  • data
)
public

Defined in module.js:140

Module broadcast method.

Parameters:

  • name String

    The message label name, e.g. switch-view. You should use verb for first word and use hyphen.

  • data Mixed

    The data you want transmit to module which subscribe this message.

destructor

(
  • needRemove
)
public

Defined in module.js:162

Destroy the module instance.

Parameters:

  • needRemove Boolean

    Set false if you want to remove this module

getViewNode

() Y.Node public

Defined in module.js:177

Get the view node of this module. The purpose of creating this method is to be consistent with previous version.

Returns:

Y.Node: The view node of this module.

initializer

() public

Defined in module.js:219

Initialize the module instance.

listen

(
  • name
  • callback
)
public

Defined in module.js:189

Register a specific message you want listen.

Parameters:

  • name String

    The message name.

  • callback Function

    The function you want execute after listen this event... message name, id, data, callback

log

() public

Defined in module.js:207

A convenient alias method for Y.log(, "info", "");

Attributes

init

Function

Defined in module.js:65

The module initialization function.

listeners

String

Defined in module.js:122

The messege names this module listens to.

node

Y.Node

Defined in module.js:76

The module node.

on

Object

Defined in module.js:87

The default binding events. Current only viewload and message are acceptable.

ready

Boolean

Defined in module.js:111

Whether the module's view node is ready to be accessed.

selector

String

Defined in module.js:54

The CSS selector for module outbox element.

Events

message

public

Defined in module.js:240

It is triggered when this module receives the registered messeges. NOTE - from previous 'onmessage' handler.

viewload

public

Defined in module.js:249

Use contentready to check if module view is loaded. You can only get node attribute after this event. NOTE - from previous 'onviewload' handler.