From 32f8b04c6911c6ac2f3f83dded50e6d5c0fbeede Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Sun, 10 Jun 2012 16:35:03 -0700
Subject: Binding Panel - Minor Editing Panel changes
---
.../edit-binding-view.reel/edit-binding-view.css | 6 ++-
.../edit-binding-view.reel/edit-binding-view.html | 24 ++++++---
.../edit-binding-view.reel/edit-binding-view.js | 62 +++++++++++++++++++---
3 files changed, 78 insertions(+), 14 deletions(-)
(limited to 'js')
diff --git a/js/panels/binding/edit-binding-view.reel/edit-binding-view.css b/js/panels/binding/edit-binding-view.reel/edit-binding-view.css
index 6e2ca31c..aa539cd6 100644
--- a/js/panels/binding/edit-binding-view.reel/edit-binding-view.css
+++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.css
@@ -13,7 +13,10 @@
position: absolute;
top: 0;
width: 100%;
- -webkit-transition: -webkit-transform .55s cubic-bezier(.44,.19,0,.99);
+ -webkit-transition-property: -webkit-transform, box-shadow;
+ -webkit-transition-duration: .55s, .2s;
+ -webkit-transition-timing-function: cubic-bezier(.44,.19,0,.99);
+ -webkit-user-select: text;
}
.edit-binding-view ul {
@@ -37,6 +40,7 @@
background-color: #444;
border: 1px solid #313131;
display: inline-block;
+ height: 13px;
margin-left: 5px;
padding: 1px 4px;
width: 45%;
diff --git a/js/panels/binding/edit-binding-view.reel/edit-binding-view.html b/js/panels/binding/edit-binding-view.reel/edit-binding-view.html
index 0c1abcee..d07f4445 100644
--- a/js/panels/binding/edit-binding-view.reel/edit-binding-view.html
+++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.html
@@ -13,14 +13,19 @@
"owner": {
"prototype": "js/panels/binding/edit-binding-view.reel",
"properties": {
- "element": {"#": "edit-binding"}
+ "element": {"#": "edit-binding"},
+ "sourceObjectField" : {"@": "sourceObjectField" },
+ "boundObjectField" : {"@": "boundObjectField" },
+ "sourceObjectPropertyPathField" : {"@": "sourceObjectPropertyPathField" },
+ "boundObjectPropertyPathField" : {"@": "boundObjectPropertyPathField" },
+ "directionCheckbox" : {"@": "directionCheckbox" }
}
},
"sourceObjectField": {
"prototype": "js/components/hintable.reel",
"properties": {
+ "startOnEvent": "click",
"element": {"#": "sourceObjectField"}
-
},
"bindings": {
"value": {"<-": "@owner.sourceObjectIdentifier"}
@@ -35,6 +40,7 @@
"boundObjectField": {
"prototype": "js/components/hintable.reel",
"properties": {
+ "startOnEvent": "click",
"element": {"#": "boundObjectField"}
},
"bindings": {
@@ -50,6 +56,7 @@
"sourceObjectPropertyPathField": {
"prototype": "js/components/hintable.reel",
"properties": {
+ "startOnEvent": "click",
"element": {"#": "so-pp"},
"identifier": "sourceProperty"
},
@@ -66,6 +73,7 @@
"boundObjectPropertyPathField": {
"prototype": "js/components/hintable.reel",
"properties": {
+ "startOnEvent": "click",
"element": {"#": "bo-pp"},
"identifier": "boundProperty"
},
@@ -109,18 +117,20 @@
+ Source Object
-
- Test
+ Test
- Test
+ Test
-
+ Bound Object
-
- Test
+ Test
- Test
+ Test
+ Configuration
-
diff --git a/js/panels/binding/edit-binding-view.reel/edit-binding-view.js b/js/panels/binding/edit-binding-view.reel/edit-binding-view.js
index 1cef8f5e..c3ef7384 100644
--- a/js/panels/binding/edit-binding-view.reel/edit-binding-view.js
+++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.js
@@ -10,6 +10,17 @@ var Montage = require("montage/core/core").Montage,
exports.EditBindingView = Montage.create(Component, {
+ objectIdentifiers : {
+ value: null
+ },
+ getObjectIdentifiers : {
+ value: function() {
+ return this.application.ninja.objectsController.objects.map(function(object) {
+ return object.identifier;
+ });
+ }
+ },
+
/* -------------------
Binding Properties
------------------- */
@@ -62,16 +73,51 @@ exports.EditBindingView = Montage.create(Component, {
this._bindingArgs = value;
- this.sourceObjectIdentifier = value.sourceObject.identifier;
- this.sourceObjectPropertyPath = value.sourceObjectPropertyPath;
- this.boundObjectIdentifier = value.boundObject.identifier;
- this.boundObjectPropertyPath = value.boundObjectPropertyPath;
+ // clear form values
+ this.clearForm();
+
+ // set up hints for hintable components
+ this.objectIdentifiers = this.getObjectIdentifiers();
+ console.log("setting hints to ", this.objectIdentifiers);
+ this.boundObjectField.hints = this.objectIdentifiers;
+ this.sourceObjectField.hints = this.objectIdentifiers;
+
+ if(value.sourceObject) {
+ this.sourceObjectIdentifier = value.sourceObject.identifier || '';
+ this.sourceObjectPropertyPath = value.sourceObjectPropertyPath || '';
+ }
+
+ if(value.boundObject) {
+ this.boundObjectIdentifier = value.boundObject.identifier || '';
+ this.boundObjectPropertyPath = value.boundObjectPropertyPath || '';
+ }
+
this.oneway = value.oneway;
this.needsDraw = true;
}
},
+ /* -------------------
+ Save/Close button handlers
+ ------------------- */
+
+ "sourceObjectField" : {value: null, enumerable: true },
+ "boundObjectField" : {value: null, enumerable: true },
+ "sourceObjectPropertyPathField" : {value: null, enumerable: true },
+ "boundObjectPropertyPathField" : {value: null, enumerable: true },
+ "directionCheckbox" : {value: null, enumerable: true },
+
+ clearForm : {
+ value: function() {
+ for(var field in this) {
+ if(this.hasOwnProperty(field)) {
+ field.value = '';
+ }
+ }
+ }
+ },
+
/* -------------------
Save/Close button handlers
------------------- */
@@ -82,9 +128,13 @@ exports.EditBindingView = Montage.create(Component, {
}
},
- prepareForDraw : {
+ /* -------------------
+ Draw Cycle
+ ------------------- */
+
+ willDraw : {
value: function() {
- console.log("Preparing to draw edit view");
+
}
}
});
\ No newline at end of file
--
cgit v1.2.3