-
Notifications
You must be signed in to change notification settings - Fork 8
/
app.js
61 lines (57 loc) · 2.35 KB
/
app.js
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
'use strict';
(function($) {
angular
.module('angularSortableDemo', [
'sortable'
])
.controller('SortableCtrl', ['$scope', function($scope) {
$scope.items = [
{
name: 'JB',
profession: 'King of rock',
color: '#ff0000',
subitems: ['a', 'b', 'c', 'd', 'e']
},
{
name: 'Fred Aster',
profession: 'Dancer',
color: '#f0f000',
subitems: ['a', 'b', 'c', 'd', 'e']
},
{
name: 'Albert Einstein',
profession: 'Physician',
color: '#f000f0',
subitems: ['a', 'b', 'c', 'd', 'e']
},
{
name: 'PK Subban',
profession: 'Hockey player',
color: '#0000ff',
subitems: ['a', 'b', 'c', 'd', 'e']
},
{
name: 'Mother Theresa',
profession: 'Saint',
color: '#00ff00',
subitems: ['a', 'b', 'c', 'd', 'e']
}
];
$scope.onItemsDrag = function(event) {
// Do whatever you want here...
console.log('onItemsDrag');
};
$scope.onItemsDragstart = function(event) {
// Do whatever you want here...
console.log('onItemsDragstart');
};
$scope.onItemsDragend = function(event) {
// Do whatever you want here...
console.log('onItemsDragend');
};
$scope.onItemsChange = function(fromIdx, toIdx) {
// Do whatever you want here...
console.log('onItemsChange');
};
}]);
}(jQuery));