diff options
author | Armen Kesablyan | 2012-06-15 15:03:26 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-15 15:03:26 -0700 |
commit | 45aeaaf9aa61dcd5a55f12817ef8e6036ba74606 (patch) | |
tree | bdbe9415a3ab5a1784de3af1814cfde8d5f75913 /js/panels/objects/object.reel/object.js | |
parent | 5bf62b3dacfff71d906286716dc0d73e2cb05bb8 (diff) | |
parent | 022e2ba65070ee1e5eb2d4b197b88768a1ea3f4f (diff) | |
download | ninja-45aeaaf9aa61dcd5a55f12817ef8e6036ba74606.tar.gz |
Merge branch 'binding' of https://github.com/dhg637/ninja-internal into binding
Diffstat (limited to 'js/panels/objects/object.reel/object.js')
-rw-r--r-- | js/panels/objects/object.reel/object.js | 29 |
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 | ||
14 | exports.Object = Montage.create(Component, { | 14 | exports.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 | ||