From 336e0e0ef242f5c472757fe3bbcdd54c04a00f1f Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 14 May 2012 10:32:59 -0700 Subject: Workspace: has customized Signed-off-by: Armen Kesablyan --- js/panels/binding-panel.reel/binding-panel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 js/panels/binding-panel.reel/binding-panel.js (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js new file mode 100644 index 00000000..03fe5723 --- /dev/null +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -0,0 +1,12 @@ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + + +exports.BindingPanel = Montage.create(Component, { + + prepareForDraw: { + value: function() { + console.log("test- objects"); + } + } +}); \ No newline at end of file -- cgit v1.2.3 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. --- js/panels/binding-panel.reel/binding-panel.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 03fe5723..9fdec416 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -4,6 +4,20 @@ var Montage = require("montage/core/core").Montage, exports.BindingPanel = Montage.create(Component, { + bindings : { + value: null + }, + + templateDidLoad : { + value: function() { + Object.defineBinding(this, 'bindings', { + boundObject: this.application.ninja.objectsController, + boundObjectPropertyPath: "currentObjectBindings", + oneway: true + }); + } + }, + prepareForDraw: { value: function() { console.log("test- objects"); -- 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-panel.reel/binding-panel.js | 44 +++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 9fdec416..c2ce556c 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -4,10 +4,34 @@ var Montage = require("montage/core/core").Montage, exports.BindingPanel = Montage.create(Component, { - bindings : { + bindings : { value: null }, + editView : { value: null }, + editingClass : { value: 'editing-binding' }, + _editing: { value: null }, + editing: { + get: function() { + return this._editing; + }, + set: function(value) { + if(value === this._editing) { return; } + this._editing = value; + this.needsDraw = true; + } + }, + _translateDistance : { value: null }, + displayEditView : { + value: function(bindingArgs) { + this.editing = true; + } + }, + + /* ------------------------- + Draw Cycle + ------------------------- */ + templateDidLoad : { value: function() { Object.defineBinding(this, 'bindings', { @@ -18,9 +42,23 @@ exports.BindingPanel = Montage.create(Component, { } }, - prepareForDraw: { + willDraw: { value: function() { - console.log("test- objects"); + if(this.editing) { + this._translateDistance = this.element.offsetWidth; + } + } + }, + + draw : { + value: function() { + var transStr = '-webkit-transform'; + + if(this.editing) { + this.editView.element.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); + } else { + this.editView.element.style.removeProperty(transStr); + } } } }); \ No newline at end of file -- cgit v1.2.3 From 99f14c2998760a0d871745d41c6e3419c8137d91 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 8 Jun 2012 15:57:37 -0700 Subject: Binding Panel - Add toolbar --- js/panels/binding-panel.reel/binding-panel.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index c2ce556c..3b20a88f 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -24,6 +24,7 @@ exports.BindingPanel = Montage.create(Component, { displayEditView : { value: function(bindingArgs) { + this.editView.bindingArgs = bindingArgs; this.editing = true; } }, -- cgit v1.2.3 From 307a55d74e1ecd448ec1c5f8073dd7cd81be961f Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Sun, 10 Jun 2012 16:34:14 -0700 Subject: Binding Panel Toolbar - Add action handler --- js/panels/binding-panel.reel/binding-panel.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 3b20a88f..0641ecf5 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -6,7 +6,6 @@ exports.BindingPanel = Montage.create(Component, { bindings : { value: null }, editView : { value: null }, - editingClass : { value: 'editing-binding' }, _editing: { value: null }, editing: { get: function() { @@ -30,9 +29,21 @@ exports.BindingPanel = Montage.create(Component, { }, /* ------------------------- - Draw Cycle + Toolbar Button Actions ------------------------- */ + handleAddAction : { + value: function(e) { + var newBindingArgs = { + sourceObject : this.application.ninja.objectsController.currentObject + }; + + this.displayEditView(newBindingArgs); + } + }, + + + templateDidLoad : { value: function() { Object.defineBinding(this, 'bindings', { @@ -57,8 +68,10 @@ exports.BindingPanel = Montage.create(Component, { if(this.editing) { this.editView.element.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); + this.editView.element.style.setProperty('box-shadow', '0 0 10px rgba(0,0,0,0.2)') } else { this.editView.element.style.removeProperty(transStr); + this.editView.element.style.removeProperty('box-shadow'); } } } -- cgit v1.2.3 From d57ab6509805ba4e97d6c74be913a2c1b324af3a Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 13 Jun 2012 11:30:37 -0700 Subject: Binding Panel - Dock the edit view when transition ends so horizontal resizing works --- js/panels/binding-panel.reel/binding-panel.js | 56 ++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 6 deletions(-) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 0641ecf5..45fa4005 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -6,6 +6,19 @@ exports.BindingPanel = Montage.create(Component, { bindings : { value: null }, editView : { value: null }, + + _dockEditView : { value: null }, + dockEditView : { + get : function() { return this._dockEditView; }, + set : function(value) { + if(value === this._dockEditView) { return; } + + this._dockEditView = value; + + this.needsDraw = true; + } + }, + _editing: { value: null }, editing: { get: function() { @@ -14,6 +27,11 @@ exports.BindingPanel = Montage.create(Component, { set: function(value) { if(value === this._editing) { return; } this._editing = value; + + if(!value) { + this.dockEditView = false; + } + this.needsDraw = true; } }, @@ -28,6 +46,18 @@ exports.BindingPanel = Montage.create(Component, { } }, + /* ------------------------- + Event handlers + ------------------------- */ + + handleWebkitTransitionEnd : { + value: function(e) { + console.log("trans end"); + + this.dockEditView = this.editing; + } + }, + /* ------------------------- Toolbar Button Actions ------------------------- */ @@ -54,8 +84,16 @@ exports.BindingPanel = Montage.create(Component, { } }, + prepareForDraw : { + value: function() { + + } + }, + willDraw: { value: function() { + this.editView.element.addEventListener('webkitTransitionEnd', this, false); + if(this.editing) { this._translateDistance = this.element.offsetWidth; } @@ -64,15 +102,21 @@ exports.BindingPanel = Montage.create(Component, { draw : { value: function() { - var transStr = '-webkit-transform'; + var transStr = '-webkit-transform', + editViewEl = this.editView.element; - if(this.editing) { - this.editView.element.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); - this.editView.element.style.setProperty('box-shadow', '0 0 10px rgba(0,0,0,0.2)') + if(this.dockEditView) { + editViewEl.classList.add('edit-view-docked'); + editViewEl.style.removeProperty(transStr); } else { - this.editView.element.style.removeProperty(transStr); - this.editView.element.style.removeProperty('box-shadow'); + editViewEl.classList.remove('edit-view-docked'); + if(this.editing) { + editViewEl.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); + } else { + editViewEl.style.removeProperty(transStr); + } } + } } }); \ No newline at end of file -- cgit v1.2.3 From 054d08a26e91c3ac0d15d3506002a50b30d345ce Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 18 Jun 2012 18:57:15 -0700 Subject: Binding panel - Minor change on add button handler --- js/panels/binding-panel.reel/binding-panel.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'js/panels/binding-panel.reel/binding-panel.js') diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 45fa4005..c040c009 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -64,11 +64,15 @@ exports.BindingPanel = Montage.create(Component, { handleAddAction : { value: function(e) { - var newBindingArgs = { - sourceObject : this.application.ninja.objectsController.currentObject - }; + var sourceObject = this.application.ninja.objectsController.currentObject; - this.displayEditView(newBindingArgs); + if(sourceObject) { + this.displayEditView({ + sourceObject: sourceObject + }); + } else { + this.displayEditView(); + } } }, -- cgit v1.2.3