aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/objects-controller.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-11 10:25:49 -0700
committerArmen Kesablyan2012-06-11 10:25:49 -0700
commitaaac232727c82361771a0804049ada8fae17a549 (patch)
treecd9110dacb9e39e98a5d8bbd7f1dad2780cbcc1a /js/controllers/objects-controller.js
parent6a27268ebf1cd5fa7bf8313eb5712fd5f6985758 (diff)
parentdbb36888eda1f25387852ea79aef89d22dfd7799 (diff)
downloadninja-aaac232727c82361771a0804049ada8fae17a549.tar.gz
Merge pull request #11 from ericguzman/binding
Binding
Diffstat (limited to 'js/controllers/objects-controller.js')
-rw-r--r--js/controllers/objects-controller.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index ee203336..2ce10e82 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -69,15 +69,23 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
69 value: function(bindingArgs) { 69 value: function(bindingArgs) {
70 if(!bindingArgs) { return; } 70 if(!bindingArgs) { return; }
71 71
72
73
72 Object.deleteBinding(bindingArgs.sourceObject, bindingArgs.sourceObjectPropertyPath); 74 Object.deleteBinding(bindingArgs.sourceObject, bindingArgs.sourceObjectPropertyPath);
73 } 75 }
74 }, 76 },
75 77
76 editBindingPropertyPath : { 78 editBinding : {
77 value: function(bindingArgs, newPropertyPath) { 79 value: function(bindingArgs, newProperties) {
80 var property;
81
78 this.removeBinding(bindingArgs); 82 this.removeBinding(bindingArgs);
79 83
80 bindingArgs.boundObjectPropertyPath = 'newPropertyPath'; 84 if(newProperties) {
85 for(property in newProperties) {
86 bindingArgs[property] = newProperties[property];
87 }
88 }
81 89
82 this.addBinding(bindingArgs); 90 this.addBinding(bindingArgs);
83 } 91 }
@@ -171,7 +179,7 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
171 return this._currentObject; 179 return this._currentObject;
172 }, 180 },
173 set: function(value) { 181 set: function(value) {
174 if(value === this._currentObject) { return; } 182 //if(value === this._currentObject) { return; }
175 183
176 if(value) { 184 if(value) {
177 this.currentObjectBindings = this.getObjectBindings(value); 185 this.currentObjectBindings = this.getObjectBindings(value);