diff options
author | Armen Kesablyan | 2012-06-05 12:55:44 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-05 12:55:44 -0700 |
commit | 5ecbbe908a5527dc42d461c8ddfd33b4c7e0ba4f (patch) | |
tree | 76d796ac65f603746a5618849fd891f835677ad5 /js/panels/binding | |
parent | cd089f6692934a68bda7c303928a7c78dd13ac07 (diff) | |
parent | 9db979373f80162d463e23d400e97f37c75267d1 (diff) | |
download | ninja-5ecbbe908a5527dc42d461c8ddfd33b4c7e0ba4f.tar.gz |
Merge branch 'binding' of https://github.com/dhg637/ninja-internal into binding
Diffstat (limited to 'js/panels/binding')
5 files changed, 174 insertions, 3 deletions
diff --git a/js/panels/binding/binding-item.reel/binding-item.html b/js/panels/binding/binding-item.reel/binding-item.html index 79644a7a..95a349f8 100644 --- a/js/panels/binding/binding-item.reel/binding-item.html +++ b/js/panels/binding/binding-item.reel/binding-item.html | |||
@@ -14,6 +14,7 @@ | |||
14 | "prototype": "js/panels/binding/binding-item.reel", | 14 | "prototype": "js/panels/binding/binding-item.reel", |
15 | "properties": { | 15 | "properties": { |
16 | "element": {"#": "binding-item"}, | 16 | "element": {"#": "binding-item"}, |
17 | "editButton": {"@": "editButton" }, | ||
17 | "directionToggleButton": {"@": "directionToggleButton" } | 18 | "directionToggleButton": {"@": "directionToggleButton" } |
18 | } | 19 | } |
19 | }, | 20 | }, |
diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js index 0fc06ea8..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, { | |||
20 | set: function(value) { | 20 | set: function(value) { |
21 | if(value === this._sourceObject) { return; } | 21 | if(value === this._sourceObject) { return; } |
22 | 22 | ||
23 | this.sourceObjectLabel = value.identifier; | 23 | if(value && value.identifier) { |
24 | 24 | this.sourceObjectLabel = value.identifier; | |
25 | } | ||
26 | |||
25 | this._sourceObject = value; | 27 | this._sourceObject = value; |
26 | } | 28 | } |
27 | }, | 29 | }, |
@@ -33,7 +35,9 @@ exports.BindingItem = Montage.create(Component, { | |||
33 | set: function(value) { | 35 | set: function(value) { |
34 | if(value === this._boundObject) { return; } | 36 | if(value === this._boundObject) { return; } |
35 | 37 | ||
36 | this.boundObjectLabel = value.identifier; | 38 | if(value && value.identifier) { |
39 | this.boundObjectLabel = value.identifier; | ||
40 | } | ||
37 | 41 | ||
38 | this._boundObject = value; | 42 | this._boundObject = value; |
39 | } | 43 | } |
@@ -82,6 +86,12 @@ exports.BindingItem = Montage.create(Component, { | |||
82 | } | 86 | } |
83 | }, | 87 | }, |
84 | 88 | ||
89 | handleEditButtonAction : { | ||
90 | value: function(e) { | ||
91 | this.parentComponent.parentComponent.displayEditView(); | ||
92 | } | ||
93 | }, | ||
94 | |||
85 | /* -------------- Component Draw Cycle -------------- */ | 95 | /* -------------- Component Draw Cycle -------------- */ |
86 | 96 | ||
87 | templateDidLoad : { | 97 | templateDidLoad : { |
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 new file mode 100644 index 00000000..b0249c6c --- /dev/null +++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.css | |||
@@ -0,0 +1,36 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | .edit-binding-view { | ||
8 | background: #474747; | ||
9 | color: #FFF; | ||
10 | font-size: 11px; | ||
11 | height: 100%; | ||
12 | /*left: 100%;*/ | ||
13 | /*position: absolute;*/ | ||
14 | /*top: 0;*/ | ||
15 | width: 100%; | ||
16 | -webkit-transition: -webkit-transform 140ms ease-in; | ||
17 | } | ||
18 | |||
19 | .edit-binding-view ul { | ||
20 | padding: 0; | ||
21 | margin: 0; | ||
22 | } | ||
23 | |||
24 | .edit-binding-view li { | ||
25 | padding: 3px; | ||
26 | list-style-type: none; | ||
27 | } | ||
28 | |||
29 | /* hintable fields */ | ||
30 | |||
31 | .so-pp, .bo-pp { | ||
32 | border: 1px solid #313131; | ||
33 | padding: 1px 4px; | ||
34 | background-color: #444; | ||
35 | margin-left: 5px; | ||
36 | } \ No newline at end of file | ||
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 new file mode 100644 index 00000000..1d502a3e --- /dev/null +++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.html | |||
@@ -0,0 +1,103 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html lang="en"> | ||
8 | <head> | ||
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
10 | <link rel="stylesheet" href="edit-binding-view.css" type="text/css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "owner": { | ||
14 | "prototype": "js/panels/binding/edit-binding-view.reel", | ||
15 | "properties": { | ||
16 | "element": {"#": "edit-binding"} | ||
17 | } | ||
18 | }, | ||
19 | "objectsList" : { | ||
20 | "prototype": "montage/ui/controller/array-controller", | ||
21 | "bindings" : { | ||
22 | "content": {"<-": "@owner.objectsList"} | ||
23 | } | ||
24 | }, | ||
25 | "sourceObjectSelect": { | ||
26 | "prototype": "montage/ui/select-input.reel", | ||
27 | "properties": { | ||
28 | "element": {"#": "sourceObjectSelect"}, | ||
29 | "contentController": {"@": "objectsList"} | ||
30 | |||
31 | } | ||
32 | }, | ||
33 | "boundObjectSelect": { | ||
34 | "prototype": "montage/ui/select-input.reel", | ||
35 | "properties": { | ||
36 | "element": {"#": "boundObjectSelect"}, | ||
37 | "contentController": {"@": "objectsList"} | ||
38 | |||
39 | } | ||
40 | }, | ||
41 | "sourceObjectPropertyPathField": { | ||
42 | "prototype": "js/components/hintable.reel", | ||
43 | "properties": { | ||
44 | "element": {"#": "so-pp"}, | ||
45 | "identifier": "sourceProperty" | ||
46 | }, | ||
47 | "bindings": { | ||
48 | "value": {"<-": "@owner.sourceObjectPropertyPath"} | ||
49 | }, | ||
50 | "listeners" : [ | ||
51 | { | ||
52 | "type": "change", | ||
53 | "listener": {"@": "owner"} | ||
54 | } | ||
55 | ] | ||
56 | }, | ||
57 | "boundObjectPropertyPathField": { | ||
58 | "prototype": "js/components/hintable.reel", | ||
59 | "properties": { | ||
60 | "element": {"#": "bo-pp"}, | ||
61 | "identifier": "boundProperty" | ||
62 | }, | ||
63 | "bindings": { | ||
64 | "value": {"<-": "@owner.boundObjectPropertyPath"} | ||
65 | }, | ||
66 | "listeners" : [ | ||
67 | { | ||
68 | "type": "change", | ||
69 | "listener": {"@": "owner"} | ||
70 | } | ||
71 | ] | ||
72 | } | ||
73 | |||
74 | } | ||
75 | </script> | ||
76 | </head> | ||
77 | <body> | ||
78 | <div data-montage-id="edit-binding" class="edit-binding-view"> | ||
79 | |||
80 | <ul> | ||
81 | <li class="edit-source-object"> | ||
82 | <label>Source Object:</label><select data-montage-id="sourceObjectSelect" class="nj-skinned"></select> | ||
83 | <br> | ||
84 | <label>Source Object Property Path:</label><span data-montage-id="so-pp" class="so-pp">Test</span> | ||
85 | </li> | ||
86 | |||
87 | <li class="edit-bound-object"> | ||
88 | <label>Bound Object:</label><select data-montage-id="boundObjectSelect" class="nj-skinned"></select> | ||
89 | <br> | ||
90 | <label>Bound Object Property Path:</label><span data-montage-id="bo-pp" class="bo-pp">Test</span> | ||
91 | </li> | ||
92 | |||
93 | <li class="edit-general-properties"> | ||
94 | <input data-montage-id="oneway-checkbox" type="checkbox" class="nj-skinned"><label>Oneway</label> | ||
95 | </li> | ||
96 | <li> | ||
97 | <label>Converter</label><span>Test</span> | ||
98 | </li> | ||
99 | </ul> | ||
100 | |||
101 | </div> | ||
102 | </body> | ||
103 | </html> \ No newline at end of file | ||
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 new file mode 100644 index 000 |