Skip to content

src.core.views.trackevent view

secretrobotron edited this page Dec 10, 2012 · 2 revisions

#TrackEventView (module)

View controller for TrackEvents.

Usage:

var TrackEventView = require('path/to/module/trackevent-view.js');

##TrackEventView::dragging (read-only Property)

Reflects the current dragging state of this TrackEventView. When being dragged, this property is true. false otherwise.

@return [ Boolean ]

##TrackEventView::element (read-only Property)

DOM element used by this TrackEventView.

@return [ DOMElement ]

##TrackEventView::elementText (read-write Property)

String to display on the TrackEventView DOM element. This will be reflected on the timeline if this TrackEventView is being displayed.

@return [ String ]

##TrackEventView::end (read-write Property)

end value for the associated TrackEvent. Referenced internally to avoid conflicts.

@return [ Number ]

##TrackEventView::ghost (read-only Property)

Ghost object referenced during TrackEvent overlapping.

@return [ Object ]

##TrackEventView::parent (read-write Property)

Parent TrackView on which this TrackEventView resides. Setting this property causes UI initialization to occur since the TrackEvent may be newly added to the DOM.

@return [ TrackView ]

##TrackEventView::resizing (read-only Property)

Reflects the current resizing state of this TrackEventView. When being resized, this property is true. false otherwise.

@return [ Object ]

##TrackEventView::selected (read-write Property)

Reflects the current selection state of this TrackEventView. When selected, this property is true and vice-versa. false otherwise.

@return [ Boolean ]

##TrackEventView::start (read-write Property)

start value for the associated TrackEvent. Referenced internally to avoid conflicts.

@return [ Number ]

##TrackEventView::trackEvent (read-only Property)

TrackEvent this TrackEventView object represents.

@return [ TrackEvent ]

##TrackEventView::type (read-write Property)

type value for the associated TrackEvent. Referenced internally to avoid conflicts.

@return [ String ]

##TrackEventView::cleanupGhost (public member function)

Removes this TrackEvent's ghost and makes sure isGhost is set to false.

Usage:

t.cleanupGhost();

##TrackEventView::createGhost (public member function)

Creates a clone of the current TrackEvent that does not have an associated Popcorn event. Used to notify the user when a TrackEvent overlaps and where the new location will be when the TrackEvent is dropped.

@return [ Object ]: An object which represents a TrackEvent's ghost

Usage:

t.createGhost();

##TrackEventView::deselect (private member function)

Changes this TrackEventView's element to an unselected state, and notifies the draggable manager.

Usage:

deselect();

##TrackEventView::resetContainer (private member function)

Adjusts the element's visual properties to be in accordance with current event settings.

Usage:

resetContainer();

##TrackEventView::select (private member function)

Changes this TrackEventView's element to a selected state, and notifies the draggable manager.

Usage:

select();

##TrackEventView::setDragHandler (public member function)

Sets the handler function for dragging. This handler system is provided to circumvent a potentially costly event-calling process. Instead, the provided function is accessed directly when dragging occurs (perhaps many times/second).

  • dragHandler [ Function ]: Handler to call when drag event occurs.

Usage:

t.setDragHandler(dragHandler);

##TrackEventView::setResizeHandler (public member function)

Sets the handler function for resizing. This handler system is provided to circumvent a potentially costly event-calling process. Instead, the provided function is accessed directly when resizing occurs (perhaps many times/second).

  • dragHandler [ Function ]: Handler to call when resize event occurs.

Usage:

t.setResizeHandler(resizeHandler);

##TrackEventView::setToolTip (public member function)

Sets the title attribute of this view's dom element, thereby allowing a tooltip to become visible with appropriate browser support.

  • title [ String ]: Title to show on view element.

Usage:

t.setToolTip(title);

##TrackEventView::update (public member function)

Updates the internal references to corresponding TrackEvent properties (like start & end). Calls resetContainer before finishing.

  • options [ Dictionary ]: TrackEvent (Popcorn) options to reference when collecting data for this view.

Usage:

t.update(options);

##TrackEventView::updateGhost (public member function)

Updates the positional properties on the ghost element for this TrackEvent view.

Usage:

t.updateGhost();

Clone this wiki locally