From 9b238646d7c9d8ed1fde010cde5597f8787a8806 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 1 Jun 2012 19:04:38 -0700 Subject: Binding Panel - Item css and toggle button action handler --- js/panels/binding/binding-item.reel/binding-item.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'js/panels/binding/binding-item.reel/binding-item.js') diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js index bda62ef3..0fc06ea8 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -74,6 +74,16 @@ exports.BindingItem = Montage.create(Component, { } }, + /* -------------- Events -------------- */ + + handleDirectionToggleButtonAction : { + value: function(e) { + this.oneway = !this.oneway; + } + }, + + /* -------------- Component Draw Cycle -------------- */ + templateDidLoad : { value: function() { console.log("loaded binding item"); @@ -84,5 +94,15 @@ exports.BindingItem = Montage.create(Component, { value: function() { console.log("preparing to draw binding item"); } + }, + + draw : { + value: function() { + if(this.oneway) { + this.directionToggleButton.element.classList.remove('two-way'); + } else { + this.directionToggleButton.element.classList.add('two-way'); + } + } } }); \ No newline at end of file -- cgit v1.2.3