aboutsummaryrefslogtreecommitdiff
path: root/js/components/treeview/ninja-branch.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/treeview/ninja-branch.reel')
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.css40
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.html150
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.js131
3 files changed, 321 insertions, 0 deletions
diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.css b/js/components/treeview/ninja-branch.reel/ninja-branch.css
new file mode 100644
index 00000000..6a458cc7
--- /dev/null
+++ b/js/components/treeview/ninja-branch.reel/ninja-branch.css
@@ -0,0 +1,40 @@
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.treeRoot > .branch > ul {
8 margin-top: 0;
9}
10.branch ul {
11 list-style: none;
12 padding-left: 0;
13}
14.branch .nj-collapser {
15 -webkit-transition: height 0.14s cubic-bezier(.44,.19,0,.99);
16}
17.branch .branchCollapser ul {
18 width: 100%;
19}
20.treeRoot .branch .branch-label {
21 border-bottom: 1px solid #505050;
22 cursor: pointer;
23 padding: 3px 0 4px;
24 background-repeat: no-repeat;
25 background-position: 3px 2px;
26 box-shadow: 0 0 0 0 rgba(0,0,0,0);
27 font-weight: bold;
28 box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2);
29}
30
31/* First Level */
32.branch .branch .branch-label {
33 padding-left: 25px;
34}
35
36/* Second Level */
37.branch .branch .branch .branch-label {
38 padding-left: 45px;
39 background-position: 25px;
40} \ No newline at end of file
diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.html b/js/components/treeview/ninja-branch.reel/ninja-branch.html
new file mode 100644
index 00000000..4d557a94
--- /dev/null
+++ b/js/components/treeview/ninja-branch.reel/ninja-branch.html
@@ -0,0 +1,150 @@
1<!DOCTYPE html>
2<!-- <copyright>
3This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4No 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 href="ninja-branch.css" rel="stylesheet" type="text/css" />
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/components/treeview/ninja-branch.reel",
15 "name" : "Branch",
16 "properties" : {
17 "element" : {"#" : "branch"},
18 "label" : { "@" : "textComponent" },
19 "branchList": {"#" : "branchList"},
20 "arrayController": {"@": "arrayController" },
21 "repetition": {"@": "repetition"},
22 "leafComponent": {"@": "leaf"},
23 "branchComponent": {"@": "branch"},
24 "collapser": {"#": "branchCollapser" }
25 }
26 },
27
28 "textComponent" : {
29 "module" : "montage/ui/dynamic-text.reel",
30 "name" : "DynamicText",
31 "properties" : {
32 "element" : { "#" : "label" }
33 },
34 "bindings" : {
35 "value" : {
36 "boundObject" : {"@": "owner"},
37 "boundObjectPropertyPath": "_labelText",
38 "oneway": true
39 }
40 }
41 },
42
43 "arrayController": {
44 "module": "montage/ui/controller/array-controller",
45 "name": "ArrayController",
46 "bindings": {
47 "content": {
48 "boundObject": {"@": "owner"},
49 "boundObjectPropertyPath": "childNodes"
50 }
51 }
52 },
53
54 "leaf": {
55 "module": "js/components/treeview/ninja-leaf.reel",
56 "name": "Leaf",
57 "bindings": {
58 "sourceObject": {
59 "boundObject": {"@": "repetition" },
60 "boundObjectPropertyPath": "objectAtCurrentIteration",
61 "oneway": true
62 },
63 "labelKey" : {
64 "boundObject": {"@": "owner" },
65 "boundObjectPropertyPath": "labelKey",
66 "oneway": true
67 },
68 "branchKey" : {
69 "boundObject": {"@": "owner" },
70 "boundObjectPropertyPath": "branchKey",
71 "oneway": true
72 },
73 "treeView" : {
74 "boundObject": {"@": "owner" },
75 "boundObjectPropertyPath": "treeView",
76 "oneway": true
77 }
78 }
79 },
80
81 "branch": {
82 "module": "js/components/treeview/ninja-branch.reel",
83 "name": "Branch",
84 "bindings": {
85 "sourceObject": {
86 "boundObject": {"@": "repetition" },
87 "boundObjectPropertyPath": "objectAtCurrentIteration",
88 "oneway": true
89 },
90 "labelKey" : {
91 "boundObject": {"@": "owner" },
92 "boundObjectPropertyPath": "labelKey",
93 "oneway": true
94 },
95 "branchKey" : {
96 "boundObject": {"@": "owner" },
97 "boundObjectPropertyPath": "branchKey",
98 "oneway": true
99 },
100 "treeView" : {
101 "boundObject": {"@": "owner" },
102 "boundObjectPropertyPath": "treeView",
103 "oneway": true
104 }
105 }
106 },
107
108 "repetition": {
109 "module": "montage/ui/repetition.reel",
110 "name": "Repetition",
111 "properties": {
112 "element": { "#": "branchList" },
113 "contentController": {"@": "arrayController" }
114 }
115 },
116
117 "substitution": {
118 "module": "montage/ui/substitution.reel",
119 "name": "Substitution",
120 "properties": {
121 "element": {"#": "treeItem"},
122 "switchComponents": {
123 "leaf": {"@": "leaf"},
124 "branch": {"@": "branch"}
125
126 }
127 },
128 "bindings": {
129 "switchValue": {
130 "boundObject": {"@": "repetition"},
131 "boundObjectPropertyPath": "objectAtCurrentIteration.treeNodeType",
132 "oneway": true
133 }
134 }
135 }
136 }
137 </script>
138</head>
139<body>
140 <div id="branch" class="branch">
141 <div id="label" class="branch-label"></div>
142 <div id="branchCollapser" class="branchCollapser">
143 <ul id="branchList">
144 <li id="treeItem"></li>
145 </ul>
146 </div>
147
148 </div>
149</body>
150</html> \ No newline at end of file
diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.js b/js/components/treeview/ninja-branch.reel/ninja-branch.js
new file mode 100644
index 00000000..6b9ebb10
--- /dev/null
+++ b/js/components/treeview/ninja-branch.reel/ninja-branch.js
@@ -0,0 +1,131 @@
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
7var Montage = require("montage").Montage,
8 Component = require("montage/ui/component").Component,
9 TreeNode = require("js/components/treeview/tree-node").TreeNode;
10
11var Branch = exports.Branch = Montage.create(TreeNode, {
12 hasTemplate:{
13 value:true
14 },
15 repetition:{
16 value: null
17 },
18 prepareForDraw : {
19