diff options
author | Armen Kesablyan | 2012-06-25 16:56:06 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-25 16:56:06 -0700 |
commit | 199dd0149b5b328b52cafd5ecb07a120aa1473a7 (patch) | |
tree | 46aa1229e2cc1ab37b807946ec82cae3cccbcebd /js/controllers | |
parent | b73e0aa2cffa3ffd2b574645f6ec88dc34726caa (diff) | |
download | ninja-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.js | 10 |
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 | }, |