r3953 - in trunk/pollen-ui-angular/src/main/webapp: . js/controllers partials
Author: garandel Date: 2014-05-15 18:12:07 +0200 (Thu, 15 May 2014) New Revision: 3953 Url: http://forge.chorem.org/projects/pollen/repository/revisions/3953 Log: - delete debug code - catch error when delete the last choice - reverse downgrade angular version (it was an error) Modified: trunk/pollen-ui-angular/src/main/webapp/index.html trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html Modified: trunk/pollen-ui-angular/src/main/webapp/index.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/index.html 2014-05-15 15:37:52 UTC (rev 3952) +++ trunk/pollen-ui-angular/src/main/webapp/index.html 2014-05-15 16:12:07 UTC (rev 3953) @@ -28,10 +28,10 @@ <script src="js/conf.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular-route.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular-resource.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular-cookies.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-route.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-resource.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-cookies.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js"></script> <script src="js/libs/ckeditor/ckeditor.js"></script> Modified: trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-15 15:37:52 UTC (rev 3952) +++ trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-15 16:12:07 UTC (rev 3953) @@ -126,8 +126,6 @@ }, function () { $scope.globalVariables.lastType = choice.choiceType; $scope.globalVariables.lastDate = choice.date; - console.log(oldChoice); - console.log(choice); if (!angular.equals(oldChoice, choice)) { callBack(choice); } @@ -215,7 +213,6 @@ PollChoice.add({pollId:$routeParams.pollId, permission:$routeParams.token}, choice, function (data) { delete choice.restError; choice.topiaId = data.topiaId; - console.log(data); $scope.globalVariables.saved = true; }, function (error) { choice.restError = error.data; @@ -232,16 +229,15 @@ } $scope.deleteChoice = function (choice) { - var index = $scope.data.choices.indexOf(choice); - if (index > -1) { - $scope.data.choices.splice(index,1); - } PollChoice.delete({pollId:$routeParams.pollId, permission:$routeParams.token, choiceId: choice.topiaId}, function () { $scope.globalVariables.saved = true; + var index = $scope.data.choices.indexOf(choice); + if (index > -1) { + $scope.data.choices.splice(index,1); + } + }, function (error) { + angular.extend($scope.restError, error.data); }); - $timeout(function () { - $timeout.cancel(timeout); - },500); } var initPoll = function () { @@ -328,7 +324,6 @@ }); PollVote.add({pollId:$routeParams.pollId}, sendVote, function (returnRequest) { - console.log(returnRequest); $scope.data.votants.push(angular.copy($scope.data.vote)); $scope.globalVariables.saved = true; initVote(); Modified: trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html 2014-05-15 15:37:52 UTC (rev 3952) +++ trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html 2014-05-15 16:12:07 UTC (rev 3953) @@ -52,7 +52,6 @@ <tr ng-show="!globalVariables.editMode"> <td class="pollChoice"> <input type="text" class="form-control" placeholder="votre nom" ng-model="data.vote.voter.name" /> </td> <td ng-repeat="choice in data.vote.choice" class="pollChoice"> - {{choice.voteValue}} <input type="checkbox" name="{{choice.choice.topiaId}}" ng-model="choice.voteValue" /> </td> <td>
participants (1)
-
garandelï¼ users.chorem.org