This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit b7160584668c0c89cdd135d7a7aecc183e543392 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 28 16:24:30 2014 +0200 remove alert when can remove it --- .../src/main/webapp/js/controllers/pollCtrl.js | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 7a7ffdc..05a4d25 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -207,6 +207,11 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.tab = $scope.setTab(); $route.current = lastRoute; } + else if (lastRoute.$$route.controller != 'PollCreateCtrl' || $route.current.$$route.controller != 'PollCtrl') { + $rootScope.$broadcast('hideAlertByType', 'warning'); + $rootScope.$broadcast('hideAlertByType', 'success'); + $rootScope.$broadcast('hideAlertByType', 'info'); + } }); }); @@ -303,6 +308,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr var confirmDelete = confirm(confirmMessage); if (confirmDelete == true) { $scope.data.poll.$remove({permission:$scope.globalVariables.pollToken}, function() { + $rootScope.$broadcast('cleanAlert'); $rootScope.$broadcast('newSuccess', 'poll.deleted'); $location.path('/'); }); @@ -320,6 +326,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr var confirmClose = confirm(confirmMessage); if (confirmClose == true) { $scope.data.poll.$close({permission:$scope.globalVariables.pollToken}, function() { + $rootScope.$broadcast('cleanAlert'); $rootScope.$broadcast('newSuccess', 'poll.closed'); $route.reload(); }); @@ -331,13 +338,14 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.clonePoll = function () { if (angular.isDefined($scope.data.poll.id)) { Poll.clone({pollId: $scope.data.poll.id, permission: $scope.globalVariables.pollToken}, {}, function (data) { + $rootScope.$broadcast('cleanAlert'); $rootScope.$broadcast('newInfo', $filter('translate')('poll.created.printLink', {url: '<input type="text" class="form-control" value="' + $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + '" readonly />' }) - , -1); + , -1, data.id); $rootScope.$broadcast('newSuccess', 'poll.cloned'); $location.url('/poll/edit/'+data.id+'/'+data.permission); $route.reload(); @@ -840,13 +848,15 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.globalVariables.configError = false; $scope.globalVariables.participantError = false; + $rootScope.$broadcast('hideAlertByType', 'danger'); + $rootScope.$broadcast('newInfo', $filter('translate')('poll.created.printLink', {url: '<input type="text" class="form-control" value="' + $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + '" readonly />' }) - , -1); + , -1, data.id); $rootScope.$broadcast('newSuccess', 'poll.saved'); if ($scope.data.poll.pollType != 'FREE') { SessionStorage.save({'voterList':$scope.data.voterList}); @@ -1192,6 +1202,8 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.globalVariables.configError = false; $scope.globalVariables.participantError = false; + $rootScope.$broadcast('hideAlertByType', 'danger'); + $rootScope.$broadcast('newSuccess', 'poll.saved'); }, function (error) { $scope.tabError(error.data); @@ -1313,7 +1325,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr '<input type="text" class="form-control" value="' + $scope.globalVariables.baseUrl+'#' + redirect + '" readonly />'}) - , -1); + , -1, returnRequest.id); $rootScope.$broadcast('newSuccess', 'vote.added'); initVote(); @@ -1453,6 +1465,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr var index = $scope.data.votants.indexOf(vote); PollVote.remove({pollId:$routeParams.pollId}, vote, function () { + $rootScope.$broadcast('hideAlertById', vote.id); $scope.data.votants.splice(index, 1); }) } @@ -1598,7 +1611,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr '<input type="text" class="form-control" value="' + $scope.globalVariables.baseUrl+'#' + redirect + '" readonly />' }) - , -1); + , -1, data.id); $location.url(redirect); @@ -1659,6 +1672,8 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr } PollComment.remove({pollId:$routeParams.pollId, commentId:comment.id}, function () { + $rootScope.$broadcast('hideAlertById', comment.id); + // reload comments initComments().then(function () { // if no comment then change page if it's possible -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.