summaryrefslogtreecommitdiff
path: root/client/js/controllers/image/edit.js
blob: 9fdb3927566d4ec7eadece3be054ffb19aa4b45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * The image controller
 * 
 * @param {$scope} $scope The $scope service from angular
 */
mainApp.controller('editImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', 'upload', function ($scope, Image, Loading, Identity, upload)
    {
        $scope.$on('editImageEvent', function (eventName, image, axioms) {
            $scope.image = image;
            $scope.axioms = axioms;
            $('#editImageModal').modal('show');
        });
        $scope.data = {};
        $scope.data.visibility = "public";
        $scope.data.protected = false;

        $scope.applyEdition = function (image) {
            image.visibility = $scope.data.visibility;
            image.protected = $scope.data.protected;
            Image.updateImage(image, function(){});

        };
    }]);