Skip to content
secretrobotron edited this page Dec 10, 2012 · 3 revisions

#Target (Module)

A wrapper for Popcorn targets.

Usage:

var Target = require('path/to/module/target.js');

#Target::Target (class)

An observer/notification system.

  • options [ Dictionary ]: Initialization options:

name [ String ] Optional. Name of Target object.
element [ String ] Id of target DOM Element.

Usage:

var t = new Target(options);

##Target::Target::element (read-only property)

DOM Element wrapped by this Target object.

@return [ DOMElement ]

##Target::Target::elementID (read-only property)

Id of the DOM element wrapped by this Target object.

@return [ String ]

##Target::Target::id (read-only property)

Unique id for this Target object.

@return [ String ]

##Target::Target::isDefault (read-only property)

Flag to signify whether or not the data-butter-default attribute was set on the wrapped element.

@return [ Boolean ]

##Target::Target::json (read-write property)

Portable representation of this Target object as JSON. Returns a new object on each access (use sparingly).

@return [ JSON ]

##Target::Target::name (read-only property)

Name of this Target object.

@return [ String ]

##Target::Target::view (read-only property)

PageElement associated with the Target.

@return [ PageElement ]

##Target::Target::destroy (public member function)

Removes connection between Butter (this Target object) and the DOM Element.

Usage:

t.destroy();
Clone this wiki locally