aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-25 16:56:06 -0700
committerArmen Kesablyan2012-06-25 16:56:06 -0700
commit199dd0149b5b328b52cafd5ecb07a120aa1473a7 (patch)
tree46aa1229e2cc1ab37b807946ec82cae3cccbcebd /js/controllers
parentb73e0aa2cffa3ffd2b574645f6ec88dc34726caa (diff)
downloadninja-199dd0149b5b328b52cafd5ecb07a120aa1473a7.tar.gz
Binding View - Objects Replace existing source Object if it exists
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/objects-controller.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index 3e35ef5f..6557c14e 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -58,7 +58,15 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, {
58 value: function(bindingArgs) { 58 value: function(bindingArgs) {
59 if(!bindingArgs.sourceObject || !bindingArgs.sourceObjectPropertyPath || !bindingArgs) { return; } 59 if(!bindingArgs.sourceObject || !bindingArgs.sourceObjectPropertyPath || !bindingArgs) { return; }
60 60
61 Object.defineBinding(bindingArgs.sourceObject, bindingArgs.sourceObjectPropertyPath, bindingArgs); 61 var sourceObject = bindingArgs.sourceObject,
62 sourcePath = bindingArgs.sourceObjectPropertyPath,
63 sourceDescriptor = sourceObject._bindingDescriptors;
64
65 if(sourceDescriptor && sourceDescriptor[sourcePath]) {
66 this.removeBinding(bindingArgs);
67 }
68
69 Object.defineBinding(sourceObject, sourcePath, bindingArgs);
62 this.currentObjectBindings = this.getObjectBindings(bindingArgs.sourceObject); 70 this.currentObjectBindings = this.getObjectBindings(bindingArgs.sourceObject);
63 } 71 }
64 }, 72 },