Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 17df58c

Browse files
committed
Changed the demo page to demonstrate ui.sortable (instead of ui.date).
1 parent 176ab1f commit 17df58c

File tree

2 files changed

+93
-5
lines changed

2 files changed

+93
-5
lines changed

demo/demo.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.list {
2+
list-style: none outside none;
3+
margin: 10px 0 30px;
4+
}
5+
6+
.item {
7+
width: 200px;
8+
padding: 5px 10px;
9+
margin: 5px 0;
10+
border: 2px solid #444;
11+
border-radius: 5px;
12+
background-color: #EA8A8A;
13+
14+
font-size: 1.1em;
15+
font-weight: bold;
16+
text-align: center;
17+
cursor: move;
18+
}
19+
20+
21+
/*** Extra ***/
22+
23+
body {
24+
font-family: Verdana, 'Trebuchet ms', Tahoma;
25+
}
26+
27+
.logList {
28+
margin-top: 20px;
29+
width: 250px;
30+
min-height: 200px;
31+
padding: 5px 15px;
32+
border: 5px solid #000;
33+
border-radius: 15px;
34+
}
35+
36+
.logList:before {
37+
content: 'log';
38+
padding: 0 5px;
39+
position: relative;
40+
top: -1.1em;
41+
background-color: #FFF;
42+
}
43+
44+
.container {
45+
width:300px;
46+
margin: auto;
47+
}
48+
49+
h2 {
50+
text-align: center;
51+
}

demo/demo.html

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,53 @@
66
<head>
77
<meta charset="utf-8">
88
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9-
<title>AngularUI - Date Picker Demo</title>
9+
<title>AngularUI - Sortable Demo</title>
1010
<base href=".."></base>
1111
<link rel="stylesheet" href="components/jquery-ui/themes/smoothness/jquery-ui.css">
12+
<link rel="stylesheet" href="demo/demo.css">
1213
<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
1314
<script type="text/javascript" src="bower_components/jquery-ui/ui/jquery-ui.custom.js"></script>
1415
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
15-
<script type="text/javascript" src="src/date.js"></script>
16+
<script type="text/javascript" src="src/sortable.js"></script>
17+
<script type="text/javascript">
18+
var myapp = angular.module('sortableApp', ['ui.sortable']);
19+
20+
myapp.controller('sortableController', function ($scope) {
21+
var tmpList = [];
22+
23+
for (var i = 1; i <= 6; i++){
24+
tmpList.push({
25+
text: 'Item ' + i,
26+
value: i
27+
});
28+
}
29+
30+
$scope.list = tmpList;
31+
32+
33+
$scope.sortingLog = [];
34+
35+
$scope.sortableOptions = {
36+
// called after a node is dropped
37+
stop: function(e, ui) {
38+
var logEntry = 'Moved element: ' + ui.item.scope().item.text;
39+
$scope.sortingLog.push(logEntry);
40+
}
41+
};
42+
});
43+
</script>
1644
</head>
17-
<body ng-app="ui.date">
18-
<label>Select Date: <input type="text" ui-date ng-model="aDate"></label>
19-
<div>{{aDate}}</div>
45+
<body ng-app="sortableApp" ng-controller="sortableController">
46+
<div class="container">
47+
<h2>ui.sortable demo</h2>
48+
49+
<ul ui-sortable="sortableOptions" ng-model="list" class="list">
50+
<li ng-repeat="item in list" class="item">{{item.text}}</li>
51+
</ul>
52+
53+
<ul class="list logList">
54+
<li ng-repeat="entry in sortingLog" class="logItem">{{entry}}</li>
55+
</ul>
56+
</div>
2057
</body>
2158
</html>

0 commit comments

Comments
 (0)