From 5b303f858ab78877f26f61e87230b010460ee03b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 20 Jun 2012 11:28:32 -0700 Subject: Objects Tray - Filter list of components for those without visual representation --- js/controllers/objects-controller.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js/controllers') 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, { } }, + /* ----- Utils ----- */ + _hasPrototype : { value: function(object, prototypeName) { var prototypes = this.getPrototypes(object).map(function(proto) { @@ -201,6 +203,18 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, { } }, + ///// Returns true if the element is "non-visual", i.e. is not a component, + ///// and has not element property + + isOffStageObject : { + value: function(object) { + var isComponent = this._hasPrototype(object, "Component"), + hasValidElement = object.element && object.element.parentNode; + + return !isComponent || !hasValidElement; + } + }, + /* ---- Bindable controller properties ---- */ currentObjectBindings : { -- cgit v1.2.3