Messenger Molecule

Enable droplet to broadcast custom DOM events.

Preference Dialog

Properties

type

string, ( r )

Type of this molecule, messenger.

pref.name

string, ( r )

Specifies the event name.

pref.enableWhen

string, ( r, w )

Specifies the event that activates this molecule.  Default is none.

pref.isBroadcast

bool, ( r, w )

Specifies whether the event is sent to all droplets in the current page or a few selected droplets in a group.

pref.withData

string, ( r, w )

Specifies the object, variable, or array molecule that is to be sent along with the event or passed to the JavaScript function as input parameter.

pref.targets

array, ( r, w )

Specifies a list of droplets’ names that the event is to be delivered on key press.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

Close