From 8592cfb89db05f0e52d8c1b8c7046e6f49e3522d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 1 Feb 2012 00:09:27 -0800 Subject: Adding a montage framework copy for the user document Adding a new montage copy containing the latest version of montage to use the new native widgets Signed-off-by: Valerio Virgillito --- .../ui/substitution.reel/substitution.js | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 node_modules/montage-user/ui/substitution.reel/substitution.js (limited to 'node_modules/montage-user/ui/substitution.reel') diff --git a/node_modules/montage-user/ui/substitution.reel/substitution.js b/node_modules/montage-user/ui/substitution.reel/substitution.js new file mode 100755 index 00000000..ad4034c1 --- /dev/null +++ b/node_modules/montage-user/ui/substitution.reel/substitution.js @@ -0,0 +1,91 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module "montage/ui/substitution.reel" + @requires montage/core/core + @requires montage/ui/component + @requires montage/ui/slot + @requires core/logger +*/ +var Montage = require("montage").Montage, + Component = require("ui/component").Component, + Slot = require("ui/slot.reel").Slot, + logger = require("core/logger").logger("substitution"); +/** + @class module:"montage/ui/substitution.reel".Substitution + */ +exports.Substitution = Montage.create(Slot, /** @lends module:"montage/ui/substitution.reel".Substitution# */ { + + hasTemplate: { + enumerable: false, + value: false + }, +/** + Description TODO + @type {Property} + @default {} + */ + switchComponents: { + enumerable: false, + serializable: true, + distinct: true, + value: {} + }, +/** + Description TODO + @private +*/ + _switchValue: { + enumerable: false, + value: null + }, +/** + Description TODO + @type {Function} + @default null + */ + switchValue: { + enumerable: false, + get: function() { + return this._switchValue; + }, + set: function(value) { + + if (this._switchValue === value || this._isSwitchingContent) { + return; + } + + this._switchValue = value; + + if (this.switchComponents) { + this.content = this.switchComponents[this.switchValue]; + } + } + }, +/** + Description TODO + @type {Property} + @default null + */ + transition: { + enumerable: false, + value: null + }, +/** + Description TODO + @function + */ + prepareForDraw: { + enumerable: false, + value: function() { + + if (this.switchComponents) { + this.content = this.switchComponents[this.switchValue]; + } + } + } + +}); -- cgit v1.2.3