From a9a6d479e4f00134b32f7c3e657de3ce5cfb0c48 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 11 Jun 2012 10:27:49 -0700 Subject: Objects Panel - Add component icon and icons by type --- js/controllers/objects-controller.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js index 2ce10e82..93f78efc 100644 --- a/js/controllers/objects-controller.js +++ b/js/controllers/objects-controller.js @@ -119,20 +119,11 @@ var objectsController = exports.ObjectsController = Montage.create(Component, { } }, - /* ---- Bindable Properties ---- */ + /* ---- Get Bindable Properties ---- */ getPropertyList : { value: function(object, excludeUnderscoreProperties) { - var object_i = object, - prototypes = [object_i]; - - ///// Collect prototypes - while(Object.getPrototypeOf(object_i)) { - object_i = Object.getPrototypeOf(object_i); - prototypes.push(object_i); - } - - return prototypes.map(function(proto) { + return this.getPrototypes(object).map(function(proto) { var metadata = proto._montage_metadata, objectName = (metadata) ? metadata.objectName : "Object"; @@ -166,6 +157,21 @@ var objectsController = exports.ObjectsController = Montage.create(Component, { } }, + getPrototypes : { + value: function(object) { + var object_i = object, + prototypes = [object_i]; + + ///// Collect prototypes + while(Object.getPrototypeOf(object_i)) { + object_i = Object.getPrototypeOf(object_i); + prototypes.push(object_i); + } + + return prototypes; + } + }, + /* ---- Bindable controller properties ---- */ currentObjectBindings : { -- cgit v1.2.3