aboutsummaryrefslogtreecommitdiff
path: root/js/panels/objects/object.reel/object.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/objects/object.reel/object.js')
-rw-r--r--js/panels/objects/object.reel/object.js90
1 files changed, 90 insertions, 0 deletions
diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js
new file mode 100644
index 00000000..76f1b5bf
--- /dev/null
+++ b/js/panels/objects/object.reel/object.js
@@ -0,0 +1,90 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7/**
8 @requires montage/core/core
9 @requires montage/ui/component
10 */
11var Montage = require("montage/core/core").Montage,
12 Component = require("montage/ui/component").Component;
13
14exports.Object = Montage.create(Component, {
15 _needsPropertyInspection : { value: null },
16 iconElement : { value: null },
17 type : { value: null },
18
19 _sourceObject : { value: null },
20 sourceObject : {
21 get: function() {
22 return this._sourceObject;
23 },
24 set: function(object) {
25 if(this._sourceObject === object) { return false; }
26
27 this._sourceObject = object;
28
29 if(object._montage_metadata) {
30 this.montageMetaData = object._montage_metadata;
31 this.type = this.application.ninja.objectsController.getObjectCategory(object);
32 }
33
34 this._needsPropertyInspection = this.needsDraw = true;
35 }
36
37 },
38
39 _identifier : {
40 value: null
41 },
42 identifier : {
43 get: function() {
44 return this._identifier;
45 },
46 set: function(value) {
47 if(this._identifier === value || !value) { return false; }
48
49 this._identifier = value;
50
51 this.label = value;
52
53 this.needsDraw = true;
54 }
55
56 },
57
58 _montageMetaData : {
59 value: null
60 },
61 montageMetaData : {
62 get: function() {
63 return this._montageLabel;
64 },
65 set: function(data) {
66 if(this._montageMetaData === data) { return false; }
67
68 this._montageMetaData = data;
69
70 if(!this.identifier && data.label) {
71 this.label = data.label;
72 this.needsDraw = true;
73 }
74 }
75
76 },
77
78 draw : {
79 value: function() {
80 if(this.type) {
81 this.iconElement.classList.add('object-icon-'+this.type.toLowerCase());
82 } else{
83 this.iconElement.classList.add('object-icon-default');
84 }
85
86
87 }
88 }
89
90}); \ No newline at end of file