This repository has been archived by the owner on Apr 23, 2019. It is now read-only.
forked from nelsonblaha/draggable-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
41 lines (39 loc) · 1.63 KB
/
demo.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
<div ng-app="app" ng-cloak>
<div ng-controller="TreeController">
{{data|json}}
<div>
<button ng-click="addChild(data)">+ New</button>
</div>
<div class="live">
<ol ui-nested-sortable="{
listType: 'ol',
items: 'li',
doNotClear: true,
placeholder: 'ui-state-highlight',
forcePlaceholderSize: true,
toleranceElement: '> div'
}" ui-nested-sortable-stop="update($event, $ui)">
<li ya-tree="child in data.children at ol" ng-class="{minimized:child.minimized}" item="{{child}}">
<div>
<button class="toggle" ng-click="toggleMinimized(child)" ng-switch on="child.minimized"><span ng-switch-when="true">▶</span><span ng-switch-default>▼</span>
</button>
<input ng-model="child.title" />
<button ng-click="addChild(child)">+</button>
<button ng-click="remove(child)">x</button>
</div>
<ol ng-class="{pregnant:child.children.length}"></ol>
</li>
</ol>
</div>
<div class="shadow">
<ol>
<li ya-tree="child in data.children at ol" class="bg{{$depth%6}}" ng-class="{minimized:child.minimized}">
<div>
<input disabled value="{{child.title}}" /> <em>({{$depth}})</em>
</div>
<ol ng-class="{pregnant:child.children.length}"></ol>
</li>
</ol>
</div>
</div>
</div>