diff options
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/objects-controller.js | 27 |
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 @@ | |||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | var CATEGORIES = { | ||
11 | |||
12 | }; | ||
13 | |||
10 | var objectsController = exports.ObjectsController = Montage.create(Component, { | 14 | var 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 : { |