From 9fe73eaccdd7e3d82bb4cd5326f126ee683a2d25 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Sun, 10 Jun 2012 17:22:01 -0700 Subject: Binding Panel - Direction toggle changes are savable. --- js/controllers/objects-controller.js | 12 +++++++++--- js/panels/binding/binding-item.reel/binding-item.js | 6 ++++++ 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, { } }, - editBindingPropertyPath : { - value: function(bindingArgs, newPropertyPath) { + editBinding : { + value: function(bindingArgs, newProperties) { + var property; + this.removeBinding(bindingArgs); - bindingArgs.boundObjectPropertyPath = 'newPropertyPath'; + if(newProperties) { + for(property in newProperties) { + bindingArgs[property] = newProperties[property]; + } + } this.addBinding(bindingArgs); } 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, { }, set: function(value) { if(value === this._oneway) { return; } + this._oneway = value; + this.needsDraw = true; } }, @@ -87,6 +89,10 @@ exports.BindingItem = Montage.create(Component, { handleDirectionToggleButtonAction : { value: function(e) { this.oneway = !this.oneway; + this.application.ninja.objectsController.editBinding(this.bindingArgs, { + oneway: !this.bindingArgs.oneway + }); + this.application.ninja.objectsController. } }, -- cgit v1.2.3