istic-openstack/client/js/controllers/image/edit.js
2016-04-27 15:52:58 +02:00

24 lines
816 B
JavaScript

/**
* 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');
console.log(image)
});
$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(){});
};
}]);