File: main.js

package info (click to toggle)
libjs-lrdragndrop 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,152 kB
  • sloc: javascript: 404; makefile: 10
file content (36 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download | duplicates (4)
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
angular.module('app', ['lrDragNDrop'])
    .controller('safeCtrl', ['$scope', function (scope) {
        scope.collection = [
            {src: 'img/pict1.jpg', title: 'picture 1'},
            {src: 'img/pict2.jpg', title: 'picture 2'},
            {src: 'img/pict3.jpg', title: 'picture 3'}
        ];
        scope.collectionBis = [
            {src: 'img/pict4.jpg', title: 'picture 4'},
            {src: 'img/pict5.jpg', title: 'picture 5'},
            {src: 'img/pict6.jpg', title: 'picture 6'}
        ];
    }])
    .controller('nonSafeCtrl', ['$scope', function (scope) {
        scope.collection = [
            {src: 'img/pict1.jpg', title: 'picture 1'},
            {src: 'img/pict2.jpg', title: 'picture 2'},
            {src: 'img/pict3.jpg', title: 'picture 3'}
        ];
        scope.collectionBis = [
            {src: 'img/pict4.jpg', title: 'picture 4'},
            {src: 'img/pict5.jpg', title: 'picture 5'},
            {src: 'img/pict6.jpg', title: 'picture 6'}
        ];
        scope.dropSuccess = function(e, item, collection) {
            console.log('dropSuccess');
            console.log(e, item, collection);
        };
    }])
    .controller('reorderCtrl', ['$scope', function (scope) {
        scope.collection = [
            {src: 'img/pict1.jpg', title: 'picture 1'},
            {src: 'img/pict2.jpg', title: 'picture 2'},
            {src: 'img/pict3.jpg', title: 'picture 3'}
        ];
    }]);