# HG changeset patch # User cavaliet # Date 1412348668 -7200 # Node ID c6ff299149831157e2c33a608115963874e34368 # Parent 28208a0ad8b94949190ea3ffcc809d665d22b444 delete item from gallery diff -r 28208a0ad8b9 -r c6ff29914983 client/app/gallery/gallery.html --- a/client/app/gallery/gallery.html Fri Oct 03 16:15:50 2014 +0200 +++ b/client/app/gallery/gallery.html Fri Oct 03 17:04:28 2014 +0200 @@ -6,8 +6,11 @@

{{ i.title }}

- +
diff -r 28208a0ad8b9 -r c6ff29914983 client/app/gallery/gallery_controller.js --- a/client/app/gallery/gallery_controller.js Fri Oct 03 16:15:50 2014 +0200 +++ b/client/app/gallery/gallery_controller.js Fri Oct 03 17:04:28 2014 +0200 @@ -12,6 +12,14 @@ .controller('galleryCtrl', function($scope, $location, slideshowModel){ console.log('gallery 5',$scope, $location, slideshowModel); $scope.gallery = slideshowModel.slideshow; + + $scope.deleteItem = function(i){ + if(0<=i && i<$scope.gallery.images.length){ + if(window.confirm('Êtes-vous sûr(e) de vouloir effacer cet élément ? Cette action est irrémédiable.')){ + $scope.gallery.images.splice(i, 1); + } + } + }; }); })();