From 47d45e16bee15fd9f1f793a0bad3b93ad1b985fc Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Mon, 11 Jun 2012 07:19:19 -0700
Subject: Edit View - Add buttons and calls controller (saves bindings)
---
js/document/templates/app/main.js | 2 +-
.../edit-binding-view.reel/edit-binding-view.html | 44 ++++++++++--
.../edit-binding-view.reel/edit-binding-view.js | 81 ++++++++++++++++++++--
3 files changed, 116 insertions(+), 11 deletions(-)
diff --git a/js/document/templates/app/main.js b/js/document/templates/app/main.js
index 91c46fda..e2bdc1a0 100644
--- a/js/document/templates/app/main.js
+++ b/js/document/templates/app/main.js
@@ -29,7 +29,7 @@ exports.Main = Montage.create(Component, {
var componentRequire = component[data.name];
var componentInstance = componentRequire.create();
- componentInstance._montage_metadata.label = data.name;
+ componentInstance._montage_metadata.label = componentInstance.identifier = data.name;
componentInstance.element = element;
componentInstance.needsDraw = true;
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 d07f4445..604d4871 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
@@ -18,7 +18,10 @@
"boundObjectField" : {"@": "boundObjectField" },
"sourceObjectPropertyPathField" : {"@": "sourceObjectPropertyPathField" },
"boundObjectPropertyPathField" : {"@": "boundObjectPropertyPathField" },
- "directionCheckbox" : {"@": "directionCheckbox" }
+ "directionCheckbox" : {"@": "directionCheckbox" },
+ "saveButton":{ "@": "saveButton" },
+ "cancelButton":{ "@": "cancelButton" },
+ "deleteButton":{ "@": "deleteButton" }
}
},
"sourceObjectField": {
@@ -96,11 +99,40 @@
"checked": {"<-": "@owner.oneway"}
}
},
- "closeButton" : {
+ "cancelButton" : {
"prototype": "montage/ui/button.reel",
"properties": {
- "element": {"#": "close-button" },
- "identifier": "closeButton"
+ "element": {"#": "cancel-button" },
+ "identifier": "cancelButton"
+ },
+ "listeners": [
+ {
+ "type": "action",
+ "listener": {"@": "owner" }
+ }
+ ]
+ },
+ "deleteButton" : {
+ "prototype": "montage/ui/button.reel",
+ "properties": {
+ "element": {"#": "delete-button" },
+ "identifier": "deleteButton"
+ },
+ "listeners": [
+ {
+ "type": "action",
+ "listener": {"@": "owner" }
+ }
+ ]
+ },
+ "saveButton" : {
+ "prototype": "montage/ui/button.reel",
+ "properties": {
+ "element": {"#": "save-button" },
+ "identifier": "saveButton"
+ },
+ "bindings" : {
+ "enabled": {"<<->": "@owner.dirty"}
},
"listeners": [
{
@@ -139,7 +171,9 @@
-
+
+
+