summaryrefslogtreecommitdiff
path: root/client/js/controllers/image/image.js
diff options
context:
space:
mode:
authorLoic GUEGAN <loic@Manzerbredes.home>2016-05-06 14:24:15 +0200
committerLoic GUEGAN <loic@Manzerbredes.home>2016-05-06 14:24:15 +0200
commit2856a776dbedfdef2ace3cd4b4c06d1e8ebe6151 (patch)
treef10bf1f179790623ad7ba27a977125271c8e4b3a /client/js/controllers/image/image.js
parent664cddd4fa519c2e8a9233a36c0fd020f7142cd6 (diff)
Add image creation and suppression
Diffstat (limited to 'client/js/controllers/image/image.js')
-rwxr-xr-xclient/js/controllers/image/image.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js
index 7ce3bb9..b402b52 100755
--- a/client/js/controllers/image/image.js
+++ b/client/js/controllers/image/image.js
@@ -22,13 +22,29 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', '$roo
}
}
+ // Manager logout event
+ $scope.$on('updateImageEvent', function () {
+ // If user is login try to retrieve data
+ if (Identity.isAlreadyLogin()) {
+ Loading.start();
+ Image.getImages(callMeAfterGetImage);
+ }
+ });
+
$scope.edit = function (image) {
$rootScope.$broadcast("editImageEvent", image, Image.getData().axioms);
}
- $scope.showUploadImageModal = function () {
- $rootScope.$broadcast("showUploadImageModalEvent");
+ $scope.showCreateImageModal = function () {
+ $rootScope.$broadcast("showCreateImageModalEvent");
};
+
+ $scope.deleteImage = function (id) {
+ Image.deleteImage(id, function () {
+ $rootScope.$broadcast("updateImageEvent");
+
+ })
+ }
}]);