Merge branch 'loic-image-edition' into loic
This commit is contained in:
commit
9a93133272
7 changed files with 135 additions and 28 deletions
24
client/js/controllers/image/edit.js
Normal file
24
client/js/controllers/image/edit.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* 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(){});
|
||||
|
||||
};
|
||||
}]);
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* @param {$scope} $scope The $scope service from angular
|
||||
*/
|
||||
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', function ($scope, Image, Loading, Identity)
|
||||
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity','$rootScope', function ($scope, Image, Loading, Identity, $rootScope)
|
||||
{
|
||||
// Update view
|
||||
var callMeAfterGetImage = function () {
|
||||
|
@ -20,4 +20,9 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', funct
|
|||
callMeAfterGetImage();
|
||||
}
|
||||
}
|
||||
|
||||
$scope.edit=function(image){
|
||||
$rootScope.$broadcast("editImageEvent", image, Image.getData().axioms);
|
||||
|
||||
}
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue