Debian Codegraph @

example/index.html

raw
1
2 <!DOCTYPE html>
3 <html ng-app="app">
4 <head>
5 <title>lrDragNDrop demo</title>
6 <link rel="stylesheet" type="text/css" href="mainStyle.css">
7 <script src="../bower_components/angular/angular.js"></script>
8 <script src="../lrDragNDrop.js"></script>
9 <script src="main.js"></script>
10 </head>
11 <body>
12 <section ng-controller="nonSafeCtrl">
13 <h2>Non safe source ("lr-drag-src")</h2>
14
15 <p>Drag from the left collection and drop into the right collection. This is somehow equivalent to a cut operation</p>
16
17 <div class="source">
18 <h3>source collection</h3>
19 <ul>
20 <li lr-drag-src="unsafe" ng-repeat="item in collection">
21 <h4>{{ item.title }}</h4>
22 <img ng-src="{{ item.src }}" title="{{ item.title }}">
23 </li>
24 </ul>
25 <div class="model-container"><span>model:</span>
26
27 <div class="model">{{ collection | json }}</div>
28 </div>
29 </div>
30 <div class="target">
31 <h3>target collection</h3>
32 <ul>
33 <li lr-drop-target="unsafe" ng-repeat="item in collectionBis" lr-drop-success="dropSuccess(e, item, collection)">
34 <h4>{{ item.title }}</h4>
35 <img ng-src="{{ item.src }}" title="{{ item.title }}">
36 </li>
37 </ul>
38 <div class="model-container"><span>model:</span>
39
40 <div class="model">{{ collectionBis | json }}</div>
41 </div>
42 </div>
43 </section>
44 <section ng-controller="safeCtrl">
45 <h2>Safe source ("lr-drag-src-safe")</h2>
46
47 <p>Drag from the left collection and drop into the right collection. This is somehow equivalent to a copy operation</p>
48
49 <div class="source">
50 <h3>source collection</h3>
51 <ul>
52 <li lr-drag-src-safe="safe" ng-repeat="item in collection">
53 <h4>{{ item.title }}</h4>
54 <img ng-src="{{ item.src }}" title="{{ item.title }}">
55 </li>
56 </ul>
57 <div class="model-container"><span>model:</span>
58
59 <div class="model">{{ collection | json }}</div>
60 </div>
61 </div>
62 <div class="target">
63 <h3>target collection</h3>
64 <ul>
65 <li lr-drop-target="safe" ng-repeat="item in collectionBis">
66 <h4>{{ item.title }}</h4>
67 <img ng-src="{{ item.src }}" title="{{ item.title }}">
68 </li>
69 </ul>
70 <div class="model-container"><span>model:</span>
71
72 <div class="model">{{ collectionBis | json }}</div>
73 </div>
74 </div>
75 </section>
76 <section ng-controller="reorderCtrl">
77 <h2>When the target is also the source</h2>
78
79 <p>Drag and drop the items to reorder them</p>
80
81 <div>
82 <ul>
83 <li lr-drag-src="reorder" lr-drop-target="reorder" ng-repeat="item in collection"><h4>{{ item.title }}</h4>
84 <img ng-src="{{ item.src }}" title="{{ item.title }}"></li>
85 </ul>
86 <div class="model-container"><span>model:</span>
87
88 <div class="model">{{ collection | json }}</div>
89 </div>
90 </div>
91 </section>
92 </body>
93 </html>