Skip to content

Commit 14de247

Browse files
Ben RubinBen Rubin
authored andcommitted
update style
update branch update test app
1 parent 0612458 commit 14de247

File tree

4 files changed

+267
-69
lines changed

4 files changed

+267
-69
lines changed

docsApp/pages/home/home.controller.js

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,133 @@ angular
55

66
function HomeController($scope) {
77
var vm = this;
8+
var masterPanel = angular.element(document.body.querySelector('.master-panel'));
89
vm.selectedItems = [];
910

11+
$scope.$watch(function () { return vm.selectedItems; }, function (value) {
12+
masterPanel.toggleClass('closed', !value.length);
13+
}, true);
14+
15+
1016
vm.locationData = [
1117
{
1218
id: 1,
13-
name: 'Smashburger texas Austin north'
19+
name: 'One',
20+
menus: [
21+
{
22+
id: 1,
23+
name: 'One',
24+
items: [
25+
{
26+
id: 1,
27+
name: 'One'
28+
}
29+
]
30+
}
31+
]
32+
},
33+
{
34+
id: 2,
35+
name: 'Two',
36+
menus: [
37+
{
38+
id: 2,
39+
name: 'Two',
40+
items: [
41+
{
42+
id: 2,
43+
name: 'Two'
44+
}
45+
]
46+
}
47+
]
48+
}
49+
];
50+
51+
vm.locationData2 = [
52+
{
53+
id: 1,
54+
name: 'Smashburger texas Austin north',
55+
menus: [
56+
{
57+
id: 1,
58+
name: 'menu One',
59+
items: [
60+
{
61+
id: 1,
62+
name: 'Item One',
63+
price: '12.00'
64+
},
65+
{
66+
id: 2,
67+
name: 'Item two',
68+
price: '12.00'
69+
},
70+
{
71+
id: 3,
72+
name: 'Item Three',
73+
price: '12.00'
74+
}
75+
]
76+
},
77+
{
78+
id: 1,
79+
name: 'menu Two',
80+
items: [
81+
{
82+
id: 1,
83+
name: 'Item One',
84+
price: '12.00'
85+
}
86+
]
87+
}
88+
]
1489
},
1590
{
1691
id: 2,
1792
name: 'Smashburger texas Austin south'
1893
},
1994
{
2095
id: 3,
21-
name: 'Smashburger texas San marcos'
96+
name: 'Smashburger texas San marcos',
97+
menus: [
98+
{
99+
id: 1,
100+
name: 'menu One',
101+
items: [
102+
{
103+
id: 1,
104+
name: 'Item One',
105+
price: '12.00'
106+
},
107+
{
108+
id: 2,
109+
name: 'Item two',
110+
price: '12.00'
111+
},
112+
{
113+
id: 3,
114+
name: 'Item Three',
115+
price: '12.00'
116+
}
117+
]
118+
},
119+
{
120+
id: 1,
121+
name: 'menu Two',
122+
items: [
123+
{
124+
id: 1,
125+
name: 'Item One',
126+
price: '12.00'
127+
}
128+
]
129+
}
130+
]
22131
},
23132
{
24133
id: 4,
25-
name: 'Smashburger texas Waco',
134+
name: 'one',
26135
menus: [
27136
{
28137
id: 1,

docsApp/pages/home/home.html

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
<input ng-model="searchTerm" />
12
<div layout="row">
23
<md-tree ng-model="vm.selectedItems" restrict-selection="depth" flex>
3-
<md-branch branch-repeat="location in vm.locationData" class="md-2-line" select>
4+
<md-branch branch-repeat="location in vm.locationData | filter: searchTerm | orderBy: location.name" class="md-2-line" select>
45
<div class="md-branch-text">
56
<h3>{{location.name}}</h3>
67
<p>Location</p>
78
</div>
89

9-
<md-branch branch-repeat="menu in location.menus" class="md-2-line" select>
10+
<md-branch branch-repeat="menu in location.menus | filter: searchTerm | orderBy: menu.name" class="md-2-line" select>
1011
<div class="md-branch-text">
1112
<h3>{{menu.name}}</h3>
1213
<p>Menu</p>
1314
</div>
1415

15-
<md-branch branch-repeat="item in menu.items" class="md-2-line">
16+
<md-branch branch-repeat="item in menu.items | filter: searchTerm | orderBy: item.name" class="md-2-line">
1617
<div class="md-branch-text">
1718
<h3>{{item.name}}</h3>
1819
<p>Item</p>
@@ -22,12 +23,46 @@ <h3>{{item.name}}</h3>
2223
</md-branch>
2324
</md-tree>
2425

25-
<div style="width: 420px; padding: 0 16px; border-left: 1px solid #ccc; height: 100%;">
26+
<div class="master-panel closed">
27+
<h4 style="width: 120px; margin: 0 auto; padding-top: 16px;">Master Panel</h4>
28+
</div>
29+
30+
<div style="width: 420px; padding: 0 16px; border-left: 1px solid #ccc; height: 100%; z-index: 99; background: #EEE;">
31+
<h2>Tree Component</h2>
32+
<p>Welcome !</p>
33+
<p>This version is only to showcase the main interaction. Not All the things work yet.</p>
34+
<p>The core that handles the data and filtering is still under construction so you will not be able to manipluate(add, change, remove, filter) the tree at this time.</p>
35+
<p>
36+
You can leave comments about the tree here<br />
37+
<a href="https://bypassmobile.atlassian.net/wiki/display/PROD/Tree+live+demo">Confluence Doc Link</a>
38+
</p>
39+
<p>Have Fun :)</p>
2640
<h3>Selected Items ({{vm.selectedItems.length}})</h3>
2741
<p ng-repeat="item in vm.selectedItems">{{item.name}}</p>
2842
</div>
2943
</div>
3044

45+
<style>
46+
.master-panel {
47+
position: relative;
48+
width: 120px;
49+
right: 0;
50+
padding: 0 16px;
51+
border-left: 1px solid #ccc;
52+
height: 100%;
53+
background:rgb(244, 223, 255);
54+
transition: all 0.2s linear;
55+
z-index: 98;
56+
overflow: hidden;
57+
}
58+
59+
.master-panel.closed {
60+
width: 0;
61+
padding: 0;
62+
border: none;
63+
}
64+
</style>
65+
3166

3267
<!-- <md-list>
3368
<md-list-item ng-repeat="location in vm.locationData">

0 commit comments

Comments
 (0)