aboutsummaryrefslogtreecommitdiff
path: root/js/panels/objects/object.reel/object.js
diff options
context:
space:
mode:
authorEric Guzman2012-06-13 19:07:54 -0700
committerEric Guzman2012-06-13 19:07:54 -0700
commit3a2b178e93767b6e4f463fbc0a44e4b0d00ceec9 (patch)
tree88b4abb0b7f67f7b638b8594e926654a0bef60e3 /js/panels/objects/object.reel/object.js
parent98c6f4c449587addbeebb805ae0d15c4fe956f4f (diff)
downloadninja-3a2b178e93767b6e4f463fbc0a44e4b0d00ceec9.tar.gz
Objects Panel - Fix CSS to simplify showing object icons in other panels
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