-
Notifications
You must be signed in to change notification settings - Fork 0
/
topic-tree.html
128 lines (127 loc) · 4.64 KB
/
topic-tree.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<div class="tree-control">
<div class="selectize-input" ng-click="tsVm.onControlClicked()">
<span ng-if="tsVm.selectedItem" class="selected-items">
<span class="selected-item">{{tsVm.selectedItem.label}}
<span class="selected-item-close"
ng-click="tsVm.deselectItem(tsVm.selectedItem)">Remove</span>
</span>
</span>
<input
class="input-filter"
ng-if="!tsVm.selectedItem"
type="text"
ng-model="tsVm.filterKeyword"
ng-change="tsVm.filterChange()"
ng-click="onFilterClicked($event)"
placeholder="Select or enter one topic that best represents your content">
</div>
<div
class="tree-view"
id="topic-item-container" du-scroll-container
ng-show="tsVm.showTree">
<ul
class="tree-container">
<li
class="tree-item"
ng-repeat="item in tsVm.utmostTopics"
id="{{'item-' + item.id}}"
ng-if="!tsVm.filterKeyword">
<span
class="tree-group"
ng-class="tsVm.selectedOne == item ? 'active' : ''">
<span
class="tree-toggle"
ng-if="item.hasChild"
ng-click="tsVm.openTree(item)">
<i class="toggle"
ng-class="item.childOpen ? 'expanded' : 'collapsed'"></i>
</span>
<span
class="tree-select"
ng-class="item.hasChild ? 'has--child' : 'no--child'"
ng-click="tsVm.pushToSelect(item); tsVm.openTree(item);">
<span ng-class="{'name-selected': item.checked}">{{item.label}}</span>
</span>
</span>
<ul ng-if="item.childOpen">
<li
class="tree-item"
id="{{'item-' + firstChild.id}}"
ng-repeat="firstChild in item.children">
<span
class="tree-group"
ng-class="tsVm.selectedOne == firstChild ? 'active' : ''">
<span
class="tree-toggle tree--first"
ng-if="firstChild.hasChild"
ng-click="tsVm.openTree(firstChild)"
ng-class="item.hasChild ? 'has--child' : 'no--child'">
<i
class="toggle"
ng-class="firstChild.childOpen ? 'expanded' : 'collapsed'"
></i>
</span>
<span
class="tree-select"
ng-click="tsVm.pushToSelect(firstChild); tsVm.openSecondTree(firstChild);"
ng-class="firstChild.hasChild ? 'has--child' : 'no--child tree--first'">
<span ng-class="{'name-selected': firstChild.checked}">{{firstChild.label}}</span>
</span>
</span>
<ul ng-if="firstChild.childOpen">
<li
class="tree-item"
id="{{'item-' + secondChild.id}}"
ng-repeat="secondChild in firstChild.children">
<span
class="tree-group"
ng-class="tsVm.selectedOne == secondChild ? 'active' : ''">
<span
class="tree-select tree--second"
ng-click="tsVm.pushToSelect(secondChild)">
<span ng-class="{'name-selected': secondChild.checked}">{{secondChild.label}}</span>
</span>
</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="tree-view" ng-if="tsVm.filterKeyword">
<ul class="tree-container">
<li
class="tree-item"
id="{{'item-' + item.id}}"
ng-class="tsVm.selectedOne == item ? 'active' : ''"
ng-if="tsVm.filterTopics.length > 0"
ng-repeat="item in tsVm.filterTopics">
<span class="tree-group">
<span
class="tree-select"
ng-click="tsVm.pushToSelect(item)">
<span ng-bind="item.label"></span>
<span
class="item--parent"
ng-bind="item.parent.label"><span>
</span>
</span>
</li>
<li
class="tree-item"
ng-if="tsVm.filterTopics.length == 0">
<span class="tree-group">
<span
class="tree-select">
<span>No topics matched that search!</span>
</span>
</span>
</li>
</ul>
</div>
<div
class="tree-mask"
ng-if="tsVm.showTree"
ng-click="tsVm.closePopup()"></div>
</div>