aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Guzman2012-06-12 12:57:58 -0700
committerEric Guzman2012-06-12 12:57:58 -0700
commit1f855ae600c9f796bb8c6abe01fd7f9ffd15a1ac (patch)
tree3cdc92eba91efd940a3e755093a977bdf290b66a
parent3a4727ffc350216a434a7c6977b6a23653b77780 (diff)
downloadninja-1f855ae600c9f796bb8c6abe01fd7f9ffd15a1ac.tar.gz
Objects Controller - Add concept of categories
-rw-r--r--js/controllers/objects-controller.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index f700c03c..7da70520 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -7,6 +7,10 @@
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component; 8 Component = require("montage/ui/component").Component;
9 9
10var CATEGORIES = {
11
12};
13
10var objectsController = exports.ObjectsController = Montage.create(Component, { 14var objectsController = exports.ObjectsController = Montage.create(Component, {
11 15
12 _currentDocument : { 16 _currentDocument : {
@@ -172,6 +176,29 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
172 } 176 }
173 }, 177 },
174 178
179 /* ----- Category properties ----- */
180
181 getObjectCategory : {
182 value: function(object) {
183 if(this._hasPrototype(object, 'Component')) {
184 return 'Component';
185 }
186
187 return null;
188 }
189 },
190
191 _hasPrototype : {
192 value: function(object, prototypeName) {
193 var prototypes = this.getPrototypes(object).map(function(proto) {
194 var metadata = proto._montage_metadata;
195 return (metadata) ? metadata.objectName : "Object";
196 });
197
198 return prototypes.indexOf(prototypeName) !== -1;
199 }
200 },
201
175 /* ---- Bindable controller properties ---- */ 202 /* ---- Bindable controller properties ---- */
176 203
177 currentObjectBindings : { 204 currentObjectBindings : {