diff options
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/objects-controller.js | 14 |
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 : { |