aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/objects-controller.js
diff options
context:
space:
mode:
authorEric Guzman2012-06-20 11:28:32 -0700
committerEric Guzman2012-06-20 11:28:32 -0700
commit5b303f858ab78877f26f61e87230b010460ee03b (patch)
tree00b7b9e21f30aae880ffbbb4c1fd54e434fd2f2a /js/controllers/objects-controller.js
parentdc642d381e951223df3ce88ae984a3bf97d82f80 (diff)
downloadninja-5b303f858ab78877f26f61e87230b010460ee03b.tar.gz
Objects Tray - Filter list of components for those without visual representation
Diffstat (limited to 'js/controllers/objects-controller.js')
-rw-r--r--js/controllers/objects-controller.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index b8efd432..54ff14ba 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -190,6 +190,8 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, {
190 } 190 }
191 }, 191 },
192 192
193 /* ----- Utils ----- */
194
193 _hasPrototype : { 195 _hasPrototype : {
194 value: function(object, prototypeName) { 196 value: function(object, prototypeName) {
195 var prototypes = this.getPrototypes(object).map(function(proto) { 197 var prototypes = this.getPrototypes(object).map(function(proto) {
@@ -201,6 +203,18 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, {
201 } 203 }
202 }, 204 },
203 205
206 ///// Returns true if the element is "non-visual", i.e. is not a component,
207 ///// and has not element property
208
209 isOffStageObject : {
210 value: function(object) {
211 var isComponent = this._hasPrototype(object, "Component"),
212 hasValidElement = object.element && object.element.parentNode;
213
214 return !isComponent || !hasValidElement;
215 }
216 },
217
204 /* ---- Bindable controller properties ---- */ 218 /* ---- Bindable controller properties ---- */
205 219
206 currentObjectBindings : { 220 currentObjectBindings : {