aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/objects-controller.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index b75d2126..54ff14ba 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -4,14 +4,13 @@
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage;
8 Component = require("montage/ui/component").Component;
9 8
10var CATEGORIES = { 9var CATEGORIES = {
11 10
12}; 11};
13 12
14var objectsController = exports.ObjectsController = Montage.create(Component, { 13var objectsController = exports.ObjectsController = Montage.create(Montage, {
15 14
16 _currentDocument : { 15 _currentDocument : {
17 value : null, 16 value : null,
@@ -191,6 +190,8 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
191 } 190 }
192 }, 191 },
193 192
193 /* ----- Utils ----- */
194
194 _hasPrototype : { 195 _hasPrototype : {
195 value: function(object, prototypeName) { 196 value: function(object, prototypeName) {
196 var prototypes = this.getPrototypes(object).map(function(proto) { 197 var prototypes = this.getPrototypes(object).map(function(proto) {
@@ -202,6 +203,18 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
202 } 203 }
203 }, 204 },
204 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
205 /* ---- Bindable controller properties ---- */ 218 /* ---- Bindable controller properties ---- */
206 219
207 currentObjectBindings : { 220 currentObjectBindings : {