Add status to image

This commit is contained in:
Loic GUEGAN 2016-05-06 14:06:56 +02:00
parent 43e76785f0
commit 664cddd4fa
6 changed files with 279 additions and 236 deletions

View file

@ -3,7 +3,7 @@
*
* @param {$scope} $scope The $scope service from angular
*/
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity','$rootScope', function ($scope, Image, Loading, Identity, $rootScope)
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', '$rootScope', function ($scope, Image, Loading, Identity, $rootScope)
{
// Update view
@ -21,9 +21,14 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity','$root
callMeAfterGetImage();
}
}
$scope.edit=function(image){
$scope.edit = function (image) {
$rootScope.$broadcast("editImageEvent", image, Image.getData().axioms);
}
$scope.showUploadImageModal = function () {
$rootScope.$broadcast("showUploadImageModalEvent");
};
}]);

View file

@ -22,10 +22,11 @@ mainApp.controller('uploadImageCtrl', ['$scope', 'Image', 'Loading', 'Identity',
*/
$scope.doUpload = function () {
console.log($('#imageToUpload').prop('files')[0]);
/* console.log($('#imageToUpload').prop('files')[0]);
Image.uploadImage($('#imageToUpload').prop('files')[0], function () {
alert("done")
})
alert("done");
});*/
Image.uploadImage("loic",function(){})
/*$("#drop-area-div").dmUploader({
extraData: {
"token" : Identity.getToken(),
@ -57,6 +58,11 @@ mainApp.controller('uploadImageCtrl', ['$scope', 'Image', 'Loading', 'Identity',
};
// Manager logout event
$scope.$on('showUploadImageModalEvent', function () {
$scope.token = Identity.getToken();
$('#uploadImageModal').modal("show");
});
$scope.token = Identity.getToken();
}]);