From a40184e08a7ee2f189f133fd7bd83480e4bfc7f2 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 16 May 2012 22:19:34 -0700 Subject: Objects Panel - Add object component --- js/panels/objects/object.reel/object.js | 101 ++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 js/panels/objects/object.reel/object.js (limited to 'js/panels/objects/object.reel/object.js') diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js new file mode 100644 index 00000000..953c1baf --- /dev/null +++ b/js/panels/objects/object.reel/object.js @@ -0,0 +1,101 @@ +/* + 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. +
*/ + +/** + @requires montage/core/core + @requires montage/ui/component + */ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.Object = Montage.create(Component, { + _needsPropertyInspection : { value: null }, + + _sourceObject : { value: null }, + sourceObject : { + get: function() { + return this._sourceObject; + }, + set: function(object) { + if(this._sourceObject === object) { return false; } + + if(object._montage_metadata) { + this.montageMetaData = object._montage_metadata; + } + + this._needsPropertyInspection = this.needsDraw = true; + } + + }, + + _identifier : { + value: null + }, + identifier : { + get: function() { + return this._identifier; + }, + set: function(value) { + if(this._identifier === value || !value) { return false; } + + this._identifier = value; + + this.label = value; + + this.needsDraw = true; + } + + }, + + _montageMetaData : { + value: null + }, + montageMetaData : { + get: function() { + return this._montageLabel; + }, + set: function(value) { + if(this._montageMetaData === value) { return false; } + + this._montageMetaData = value; + + if(!this.identifier && value.label) { + this.label = value.label; + this.needsDraw = true; + } + } + + }, + + templateDidLoad: { + value: function() { + console.log('object loaded'); + } + }, + + prepareForDraw : { + value: function() { + + } + }, + + willDraw : { + value: function() { + if(this._needsPropertyInspection) { + + } + + console.log("This label ", this.label); + } + }, + + draw : { + value: function() { + + } + } + +}); \ No newline at end of file -- cgit v1.2.3