From 24b483db367291b72170f969de78efcb1a9b95bd Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 3 May 2012 22:53:07 -0700 Subject: integrating the latest montage version Signed-off-by: Valerio Virgillito --- node_modules/montage/ui/composer/composer.js | 45 +++++++++++++++++----------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'node_modules/montage/ui/composer/composer.js') diff --git a/node_modules/montage/ui/composer/composer.js b/node_modules/montage/ui/composer/composer.js index 52027a7c..7c30b259 100644 --- a/node_modules/montage/ui/composer/composer.js +++ b/node_modules/montage/ui/composer/composer.js @@ -5,12 +5,13 @@ */ /** @module montage/ui/event/composer/composer - @requires montage + @requires montage/core/core */ var Montage = require("montage").Montage; /** @class module:montage/ui/composer/composer.Composer - @extends module:montage.Montage + @extends module:montage/core/core.Montage + @summary The Composer prototype is the base class for all composers in Montage. There are two types of composers. One type, called _gesture_ composers listen for and aggregrate low-level events into higher order events (for example, [PressComposer]{@link module:montage/ui/composer/press-composer.PressComposer}. The second type of composer is called _calculation_ composers */ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer/composer.Composer# */ { @@ -18,6 +19,11 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer value: null }, +/** + The Montage component that the composer will listen for mouse events on. + @type {Component} + @default null +*/ component: { get: function() { return this._component; @@ -31,6 +37,11 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer value: null }, +/** + The DOM element that the composer will listen for events on. If no element is specified then the composer will use the element associated with its component property. + @type {Component} + @default null +*/ element: { get: function() { return this._element; @@ -42,11 +53,11 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer /** - * This property controls when a composer's load method is called. If `false` - * the composer's load method is called immediately as part of the next draw - * cycle after addComposer has been called on its associated component. If - * `true` loading of the composer is delayed until its associated component - * has prepareForActivationEvents called. + * This property controls when a composer's load() method is called, which is where the composer create event listeners. If `false` + * the composer's load() method is called immediately as part of the next draw + * cycle after addComposer() has been called on its associated component. If + * `true`, the loading of the composer is delayed until its associated component + * has had its prepareForActivationEvents() called. Delaying the creation of event listeners until necessary can improve performance. * @default false */ lazyLoad: { @@ -58,10 +69,9 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer }, /** - This property should be set to true when this composer wants to have its - frame method executed during the next draw cycle. Setting this property - to true will cause a draw cycle to be scheduled iff one is not already - scheduled. + This property should be set to 'true' when the composer wants to have its frame() method executed during the next draw cycle.Setting this property to 'true' will cause Montage to schedule a new draw cycle if one has not already been. + @type {boolean} + @default false */ needsFrame: { set: function(value) { @@ -80,9 +90,9 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer }, /** - This method will be invoked by the framework at the beginning of a draw cycle. This is the method where - a composer should implement its update logic. - @param {Date} timestamp time that the draw cycle started + This method will be invoked by the framework at the beginning of a draw cycle. This is where a composer implement its update logic. + @function + @param {Date} timestamp The time that the draw cycle started */ frame: { value: function(timestamp) { @@ -97,10 +107,8 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer */ _resolveDefaults: { value: function() { - if (this.element == null) { - if (this.component != null) { - this.element = this.component.element; - } + if (this.element == null && this.component != null) { + this.element = this.component.element; } } }, @@ -143,6 +151,7 @@ exports.Composer = Montage.create(Montage, /** @lends module:montage/ui/composer /* Called when a composer is part of a template serialization. It's responsible for calling addComposer on the component. + @private */ deserializedFromTemplate: { value: function() { -- cgit v1.2.3