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.css | 6 ++++++ js/panels/binding-panel.reel/binding-panel.html | 18 +++++++++++++++++- js/panels/binding-panel.reel/binding-panel.js | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) (limited to 'js/panels/binding-panel.reel') diff --git a/js/panels/binding-panel.reel/binding-panel.css b/js/panels/binding-panel.reel/binding-panel.css index e3dcf140..97b6ac91 100644 --- a/js/panels/binding-panel.reel/binding-panel.css +++ b/js/panels/binding-panel.reel/binding-panel.css @@ -7,9 +7,15 @@ .binding-panel { position: relative; height: 100%; + display: -webkit-box; + -webkit-box-orient: vertical; } .bindings-list { + -webkit-box-flex: 1; padding: 0; margin: 0; } +.binding-panel-toolbar-container { + -webkit-box-flex: 0; +} diff --git a/js/panels/binding-panel.reel/binding-panel.html b/js/panels/binding-panel.reel/binding-panel.html index a926da8d..9a2834c7 100644 --- a/js/panels/binding-panel.reel/binding-panel.html +++ b/js/panels/binding-panel.reel/binding-panel.html @@ -36,6 +36,7 @@ "element": {"#": "binding-item"} }, "bindings": { + "bindingArgs": {"<-": "@repetition.objectAtCurrentIteration"}, "sourceObjectPropertyPath": {"<-": "@repetition.objectAtCurrentIteration.sourceObjectPropertyPath"}, "sourceObject": {"<-": "@repetition.objectAtCurrentIteration.sourceObject"}, "boundObjectPropertyPath": {"<-": "@repetition.objectAtCurrentIteration.boundObjectPropertyPath"}, @@ -48,8 +49,20 @@ "properties": { "element": {"#": "edit-binding-view" } } + }, + "toolbar": { + "prototype": "js/components/toolbar.reel", + "properties": { + "element": {"#": "binding-panel-toolbar"}, + "delegate": {"@": "owner" }, + "buttons": [ + { + "title": "Add", + "identifier": "add" + } + ] + } } - } @@ -58,6 +71,9 @@ +
+
+
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') 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 dbb36888eda1f25387852ea79aef89d22dfd7799 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 11 Jun 2012 07:20:04 -0700 Subject: Binding Panel - fix scrollbar issue with abs positioned edit view. --- js/panels/binding-panel.reel/binding-panel.css | 1 + 1 file changed, 1 insertion(+) (limited to 'js/panels/binding-panel.reel') diff --git a/js/panels/binding-panel.reel/binding-panel.css b/js/panels/binding-panel.reel/binding-panel.css index 97b6ac91..a1d5be0f 100644 --- a/js/panels/binding-panel.reel/binding-panel.css +++ b/js/panels/binding-panel.reel/binding-panel.css @@ -8,6 +8,7 @@ position: relative; height: 100%; display: -webkit-box; + overflow: hidden; -webkit-box-orient: vertical; } -- cgit v1.2.3