aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Guzman2012-06-10 17:22:01 -0700
committerEric Guzman2012-06-10 17:22:01 -0700
commit9fe73eaccdd7e3d82bb4cd5326f126ee683a2d25 (patch)
tree57bcc3c3c5b58c0c57e79665b3bc02dbb3c9a65c
parent32f8b04c6911c6ac2f3f83dded50e6d5c0fbeede (diff)
downloadninja-9fe73eaccdd7e3d82bb4cd5326f126ee683a2d25.tar.gz
Binding Panel - Direction toggle changes are savable.
-rw-r--r--js/controllers/objects-controller.js12
-rw-r--r--js/panels/binding/binding-item.reel/binding-item.js6
2 files changed, 15 insertions, 3 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js
index ee203336..651cf356 100644
--- a/js/controllers/objects-controller.js
+++ b/js/controllers/objects-controller.js
@@ -73,11 +73,17 @@ var objectsController = exports.ObjectsController = Montage.create(Component, {
73 } 73 }
74 }, 74 },
75 75
76 editBindingPropertyPath : { 76 editBinding : {
77 value: function(bindingArgs, newPropertyPath) { 77 value: function(bindingArgs, newProperties) {
78 var property;
79
78 this.removeBinding(bindingArgs); 80 this.removeBinding(bindingArgs);
79 81
80 bindingArgs.boundObjectPropertyPath = 'newPropertyPath'; 82 if(newProperties) {
83 for(property in newProperties) {
84 bindingArgs[property] = newProperties[property];
85 }
86 }
81 87
82 this.addBinding(bindingArgs); 88 this.addBinding(bindingArgs);
83 } 89 }
diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js
index a2b66008..2dad2aaf 100644
--- a/js/panels/binding/binding-item.reel/binding-item.js
+++ b/js/panels/binding/binding-item.reel/binding-item.js
@@ -77,7 +77,9 @@ exports.BindingItem = Montage.create(Component, {
77 }, 77 },
78 set: function(value) { 78 set: function(value) {
79 if(value === this._oneway) { return; } 79 if(value === this._oneway) { return; }
80
80 this._oneway = value; 81 this._oneway = value;
82
81 this.needsDraw = true; 83 this.needsDraw = true;
82 } 84 }
83 }, 85 },
@@ -87,6 +89,10 @@ exports.BindingItem = Montage.create(Component, {
87 handleDirectionToggleButtonAction : { 89 handleDirectionToggleButtonAction : {
88 value: function(e) { 90 value: function(e) {
89 this.oneway = !this.oneway; 91 this.oneway = !this.oneway;
92 this.application.ninja.objectsController.editBinding(this.bindingArgs, {
93 oneway: !this.bindingArgs.oneway
94 });
95 this.application.ninja.objectsController.
90 } 96 }
91 }, 97 },
92 98