aboutsummaryrefslogtreecommitdiff
path: root/js/panels/objects/object.reel/object.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-15 15:02:30 -0700
committerArmen Kesablyan2012-06-15 15:02:30 -0700
commit022e2ba65070ee1e5eb2d4b197b88768a1ea3f4f (patch)
tree57ee0bd85f89d8b9c880337e14224536690810a4 /js/panels/objects/object.reel/object.js
parent60e9ea67e0f6d0cf167b6d5068e2e01db5f67966 (diff)
parent62c7c2ac7b72c7e89611d064eef1f4f77a54696d (diff)
downloadninja-022e2ba65070ee1e5eb2d4b197b88768a1ea3f4f.tar.gz
Merge pull request #13 from ericguzman/binding
Added Objects Tray
Diffstat (limited to 'js/panels/objects/object.reel/object.js')
-rw-r--r--js/panels/objects/object.reel/object.js29
1 files changed, 5 insertions, 24 deletions
diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js
index 1e33b7f7..76f1b5bf 100644
--- a/js/panels/objects/object.reel/object.js
+++ b/js/panels/objects/object.reel/object.js
@@ -13,16 +13,8 @@ var Montage = require("montage/core/core").Montage,
13 13
14exports.Object = Montage.create(Component, { 14exports.Object = Montage.create(Component, {
15 _needsPropertyInspection : { value: null }, 15 _needsPropertyInspection : { value: null },
16 type: { value: null }, 16 iconElement : { value: null },
17 getType : { 17 type : { value: null },
18 value: function() {
19 if(this._hasPrototype(this.sourceObject, 'Component')) {
20 return 'Component';
21 }
22
23 return null;
24 }
25 },
26 18
27 _sourceObject : { value: null }, 19 _sourceObject : { value: null },
28 sourceObject : { 20 sourceObject : {
@@ -36,7 +28,7 @@ exports.Object = Montage.create(Component, {
36 28
37 if(object._montage_metadata) { 29 if(object._montage_metadata) {
38 this.montageMetaData = object._montage_metadata; 30 this.montageMetaData = object._montage_metadata;
39 this.type = this.getType(); 31 this.type = this.application.ninja.objectsController.getObjectCategory(object);
40 } 32 }
41 33
42 this._needsPropertyInspection = this.needsDraw = true; 34 this._needsPropertyInspection = this.needsDraw = true;
@@ -83,23 +75,12 @@ exports.Object = Montage.create(Component, {
83 75
84 }, 76 },
85 77
86 _hasPrototype : {
87 value: function(object, prototypeName) {
88 var prototypes = this.application.ninja.objectsController.getPrototypes(object).map(function(proto) {
89 var metadata = proto._montage_metadata;
90 return (metadata) ? metadata.objectName : "Object";
91 });
92
93 return prototypes.indexOf(prototypeName) !== -1;
94 }
95 },
96
97 draw : { 78 draw : {
98 value: function() { 79 value: function() {
99 if(this.type) { 80 if(this.type) {
100 this.element.classList.add('object-icon-'+this.type.toLowerCase()); 81 this.iconElement.classList.add('object-icon-'+this.type.toLowerCase());
101 } else{ 82 } else{
102 this.element.classList.add('object-icon-default'); 83 this.iconElement.classList.add('object-icon-default');
103 } 84 }
104 85
105 86