aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/controllers/objects-controller.js78
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.js11
2 files changed, 50 insertions, 39 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index 14213d56..ee203336 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -94,15 +94,15 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
94 if(descriptors.hasOwnProperty(property)) { 94 if(descriptors.hasOwnProperty(property)) {
95 descriptor = descriptors[property]; 95 descriptor = descriptors[property];
96 96
97 bindingArgsObject = { 97 bindingArgsObject = {
98 sourceObject : object, 98 sourceObject : object,
99 sourceObjectPropertyPath : property, 99 sourceObjectPropertyPath : property,
100 boundObject : descriptor.boundObject, 100 boundObject : descriptor.boundObject,
101 boundObjectPropertyPath : descriptor.boundObjectPropertyPath, 101 boundObjectPropertyPath : descriptor.boundObjectPropertyPath,
102 oneway : descriptor.oneway 102 oneway : descriptor.oneway
103 }; 103 };
104 104
105 bindingsArray.push(bindingArgsObject); 105 bindingsArray.push(bindingArgsObject);
106 } 106 }
107 } 107 }
108 } 108 }
@@ -113,46 +113,46 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
113 113
114 /* ---- Bindable Properties ---- */ 114 /* ---- Bindable Properties ---- */
115 115
116 getPropertiesList : { 116 getPropertyList : {
117 value: function(object, groupByPrototype) { 117 value: function(object, excludeUnderscoreProperties) {
118 var object_i = object, 118 var object_i = object,
119 prototypes = [object_i], 119 prototypes = [object_i];
120 list;
121
122 if(groupByPrototype) {
123 ///// Collect prototypes
124 while(Object.getPrototypeOf(object_i)) {
125 object_i = Object.getPrototypeOf(object_i);
126 prototypes.push(object_i);
127 }
128
129 list = prototypes.map(function(proto) {
130 var metadata = proto._montage_metadata,
131 objectName = (metadata) ? metadata.objectName : "Object";
132 120
133 return { 121 ///// Collect prototypes
134 category : objectName, 122 while(Object.getPrototypeOf(object_i)) {
135 properties : Montage.getSerializablePropertyNames(proto) 123 object_i = Object.getPrototypeOf(object_i);
136 }; 124 prototypes.push(object_i);
137 }, this);
138 } else {
139 list = Montage.getSerializablePropertyNames(object);
140 } 125 }
141 126
127 return prototypes.map(function(proto) {
128
129 var metadata = proto._montage_metadata,
130 objectName = (metadata) ? metadata.objectName : "Object";
142 131
143 return list; 132 return {
133 category : objectName,
134 properties : this.getPropertiesFromObject(proto)
135 };
136 }, this);
144 137
145 } 138 }
146 }, 139 },
147 140
148 getBindablePropertiesFromObject : { 141 getPropertiesFromObject : {
149 value: function (object) { 142 value: function (object, excludeUnderscoreProperties) {
150 var serializableProperties = Montage.getSerializablePropertyNames(object), 143 var properties = [];
151 properties;
152 144
153 properties = serializableProperties.filter(function(prop) { 145 for(var key in object) {
154 return object.hasOwnProperty(prop); 146 if(object.hasOwnProperty(key)) {
155 }, this); 147 properties.push(key);
148 }
149 }
150
151 if(excludeUnderscoreProperties) {
152 properties = properties.filter(function(property) {
153 return property[0] !== '_';
154 }, this);
155 }
156 156
157 return properties.sort(); 157 return properties.sort();
158 } 158 }
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js
index 8ffc45c1..1457e2fc 100755
--- a/js/stage/binding-view.reel/binding-view.js
+++ b/js/stage/binding-view.reel/binding-view.js
@@ -16,9 +16,17 @@ exports.BindingView = Montage.create(Component, {
16 _selectedComponent: { 16 _selectedComponent: {
17 value: null 17 value: null
18 }, 18 },
19
20 //Bindables Format: [
21
22 //]
23
24
19 _bindables: { 25 _bindables: {
20 value: [] 26 value: []
21 }, 27 },
28
29
22 _nonVisualComponents: { 30 _nonVisualComponents: {
23 value:[] 31 value:[]
24 }, 32 },
@@ -46,9 +54,12 @@ exports.BindingView = Montage.create(Component, {
46 this._selectedComponent = val; 54 this._selectedComponent = val;
47 this.application.ninja.objectsController.currentObject = this.selectedComponent; 55 this.application.ninja.objectsController.currentObject = this.selectedComponent;
48 var arrBindings = this.application.ninja.objectsController.currentObjectBindings; 56 var arrBindings = this.application.ninja.objectsController.currentObjectBindings;
57
58 debugger;
49 arrBindings.forEach(function(obj) { 59 arrBindings.forEach(function(obj) {
50 60
51 }.bind(this)); 61 }.bind(this));
62 this.bindables.push(this._selectedComponent);
52 // Get Bindings that exist; 63 // Get Bindings that exist;
53 64
54 65