08/13: save all member when create the favoriteList and no force request post for create favoriteList
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 50e4ba115dfa8b7d2f98eaa8a8cbf9f920a3fab0 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Jun 18 17:00:53 2014 +0200 save all member when create the favoriteList and no force request post for create favoriteList --- .../src/main/webapp/js/controllers/favoriteListCtrl.js | 11 ++++++++--- .../src/main/webapp/partials/favoriteList-edit.html | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js index e1a0f3e..0f364be 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js @@ -114,6 +114,9 @@ angular.module('favoriteListControllers', []) FavoriteListPromise = FavoriteList.add({name:$scope.data.favoriteList.name}, function (data) { $scope.data.favoriteList.id = data.id; delete $scope.data.favoriteList.restError; + angular.forEach($scope.data.favoriteList.members, function (member, key) { + $scope.saveMember(member); + }) $location.url('/favoriteList/'+data.id); }, function (error) { $scope.data.favoriteList.restError = error.data; @@ -142,9 +145,11 @@ angular.module('favoriteListControllers', []) } else { // create favoriteList - $scope.saveFavoriteList().then(function () { - $scope.saveMember(member); - }); + if (angular.isUndefined($scope.data.favoriteList.restError)) { + $scope.saveFavoriteList().then(function () { + $scope.saveMember(member); + }); + } } } } diff --git a/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html b/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html index 734ccdc..130d492 100644 --- a/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html +++ b/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html @@ -28,7 +28,7 @@ <td ng-class="{'has-error':member.restError.email}"> <input type="text" ng-model="member.email" class="form-control" auto-save="saveMember(member)" tooltip="{{member.restError.email[0]}}" /> </td> - <td class="action"> <div ng-show="member.id"><button class="btn btn-danger" ng-click="deleteMember(member);" tooltip="{{ 'action.favoriteList.deleteMember' | translate }} "><span class="glyphicon glyphicon-remove"></span></button></div></td> + <td class="action"> <div ng-show="member.id"><button class="btn btn-danger" ng-click="deleteMember(member);" tooltip="{{ 'action.favoriteList.deleteMember' | translate }} "><span class="glyphicon glyphicon-trash"></span></button></div></td> </tr> <tr> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm