From 04ef4ffcfde762a0aead4a7b702f3c019fdbeb69 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 31 May 2012 21:57:22 -0700 Subject: Binding Panel - Developed panel components. --- .../binding/binding-item.reel/binding-item.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 js/panels/binding/binding-item.reel/binding-item.js (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 new file mode 100644 index 00000000..9365da65 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -0,0 +1,26 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + + +exports.BindingItem = Montage.create(Component, { + + sourceObjectPropertyPath : { value: null }, + + templateDidLoad : { + value: function() { + console.log("loaded binding item"); + } + }, + + prepareForDraw: { + value: function() { + console.log("preparing to draw binding item"); + } + } +}); \ No newline at end of file -- cgit v1.2.3 From 0f59ef2a4b78fbcee402255857e8355a67fa7e66 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 1 Jun 2012 12:53:24 -0700 Subject: Bindings Panel - Update binding panel components --- .../binding/binding-item.reel/binding-item.js | 64 +++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (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 9365da65..bda62ef3 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -9,8 +9,70 @@ var Montage = require("montage/core/core").Montage, exports.BindingItem = Montage.create(Component, { + sourceObjectLabel : { value: null }, + boundObjectLabel : { value: null }, - sourceObjectPropertyPath : { value: null }, + _sourceObject : { value: null }, + sourceObject : { + get: function() { + return this._sourceObject; + }, + set: function(value) { + if(value === this._sourceObject) { return; } + + this.sourceObjectLabel = value.identifier; + + this._sourceObject = value; + } + }, + _boundObject : { value: null }, + boundObject : { + get: function() { + return this._boundObject; + }, + set: function(value) { + if(value === this._boundObject) { return; } + + this.boundObjectLabel = value.identifier; + + this._boundObject = value; + } + }, + + _sourceObjectPropertyPath : { value: null }, + sourceObjectPropertyPath : { + get: function() { + return this._sourceObjectPropertyPath; + }, + set: function(value) { + if(value === this._sourceObjectPropertyPath) { return; } + this._sourceObjectPropertyPath = value; + this.needsDraw = true; + } + }, + _boundObjectPropertyPath : { value: null }, + boundObjectPropertyPath : { + get: function() { + return this._boundObjectPropertyPath; + }, + set: function(value) { + if(value === this._boundObjectPropertyPath) { return; } + this._boundObjectPropertyPath = value; + this.needsDraw = true; + } + }, + + _oneway : { value: null }, + oneway : { + get: function() { + return this._oneway; + }, + set: function(value) { + if(value === this._oneway) { return; } + this._oneway = value; + this.needsDraw = true; + } + }, templateDidLoad : { value: function() { -- cgit v1.2.3 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 From a5387d3cc74350dd06ecab2c8524d63d7540e57f Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 4 Jun 2012 16:37:09 -0700 Subject: Binding Panel - Add edit view --- js/panels/binding/binding-item.reel/binding-item.js | 6 ++++++ 1 file changed, 6 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 0fc06ea8..294e8d35 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -82,6 +82,12 @@ exports.BindingItem = Montage.create(Component, { } }, + handleEditButtonAction : { + value: function(e) { + this.parentComponent.parentComponent.displayEditView(); + } + }, + /* -------------- Component Draw Cycle -------------- */ templateDidLoad : { -- cgit v1.2.3 From 9274b3959384d21809c992f6f2e7860eb1682e06 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 5 Jun 2012 12:08:32 -0700 Subject: Binding Panel - Add getPropertyList and fix null currentObject --- js/panels/binding/binding-item.reel/binding-item.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (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 294e8d35..55230fc3 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -20,8 +20,10 @@ exports.BindingItem = Montage.create(Component, { set: function(value) { if(value === this._sourceObject) { return; } - this.sourceObjectLabel = value.identifier; - + if(value && value.identifier) { + this.sourceObjectLabel = value.identifier; + } + this._sourceObject = value; } }, @@ -33,7 +35,9 @@ exports.BindingItem = Montage.create(Component, { set: function(value) { if(value === this._boundObject) { return; } - this.boundObjectLabel = value.identifier; + if(value && value.identifier) { + this.boundObjectLabel = value.identifier; + } this._boundObject = value; } -- cgit v1.2.3 From af1c0007fffa3e9db6d11949a9ddec4bd697ee69 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 8 Jun 2012 15:57:57 -0700 Subject: Binding Panel - supply binding args to edit view --- js/panels/binding/binding-item.reel/binding-item.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 55230fc3..a2b66008 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -12,6 +12,10 @@ exports.BindingItem = Montage.create(Component, { sourceObjectLabel : { value: null }, boundObjectLabel : { value: null }, + bindingArgs : { + value: null + }, + _sourceObject : { value: null }, sourceObject : { get: function() { @@ -88,7 +92,7 @@ exports.BindingItem = Montage.create(Component, { handleEditButtonAction : { value: function(e) { - this.parentComponent.parentComponent.displayEditView(); + this.parentComponent.parentComponent.displayEditView(this.bindingArgs); } }, -- cgit v1.2.3 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/panels/binding/binding-item.reel/binding-item.js | 6 ++++++ 1 file changed, 6 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 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 From 7b5b65fc9183026633d97c310cbe6500082be8dd Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 11 Jun 2012 07:17:11 -0700 Subject: Binding Item - Direction Toggle button calls controller --- js/panels/binding/binding-item.reel/binding-item.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 2dad2aaf..a1017020 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -88,11 +88,13 @@ exports.BindingItem = Montage.create(Component, { handleDirectionToggleButtonAction : { value: function(e) { + var controller = this.application.ninja.objectsController; + this.oneway = !this.oneway; - this.application.ninja.objectsController.editBinding(this.bindingArgs, { + controller.editBinding(this.bindingArgs, { oneway: !this.bindingArgs.oneway }); - this.application.ninja.objectsController. + controller.currentItem = controller.currentItem; } }, -- cgit v1.2.3 From 24c6741d594b9d4167cd4de407a625eb43ebe7cc Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 23 Jun 2012 13:58:16 -0700 Subject: Binding View: Fixed If Selected Div Erroring Out Signed-off-by: Armen Kesablyan --- js/panels/binding/binding-item.reel/binding-item.js | 12 ------------ 1 file changed, 12 deletions(-) (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 a1017020..adc6320c 100644 --- a/js/panels/binding/binding-item.reel/binding-item.js +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -106,18 +106,6 @@ exports.BindingItem = Montage.create(Component, { /* -------------- Component Draw Cycle -------------- */ - templateDidLoad : { - value: function() { - console.log("loaded binding item"); - } - }, - - prepareForDraw: { - value: function() { - console.log("preparing to draw binding item"); - } - }, - draw : { value: function() { if(this.oneway) { -- cgit v1.2.3