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 8aa48134b0b5361fa35014be0e995e0456c10f64 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jun 26 12:36:13 2014 +0200 fix list Poll --- .../src/main/webapp/js/controllers/pollCtrl.js | 13 ++++++++----- pollen-ui-angular/src/main/webapp/js/services.js | 2 +- 2 files changed, 9 insertions(+), 6 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 1283f6d..9c353ac 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -728,7 +728,7 @@ angular.module('pollControllers', []) $scope.pollDeferred.promise.then(function () { if (angular.isDefined($scope.data.poll.permission)) { initPoll(); - $scope.pollDeferred.resolve('poll load'); + $scope.pollDeferred.resolve(); } else { $location.path('/'); } @@ -736,7 +736,11 @@ angular.module('pollControllers', []) $location.path('/'); }); - var oldPoll = angular.copy($scope.data.poll); + var oldPoll; + $scope.pollDeferred.promise.then(function () { + oldPoll = angular.copy($scope.data.poll); + $scope.pollDeferred.resolve(); + }); $scope.autoSavePoll = function () { if (!angular.equals(oldPoll, $scope.data.poll)) { $scope.savePoll(); @@ -1115,7 +1119,7 @@ angular.module('pollControllers', []) .controller('PollListCtrl', ['$scope', '$rootScope', '$controller', '$routeParams', '$location', 'Poll', function ($scope, $rootScope, $controller, $routeParams, $location, Poll) { - $controller('PollCtrl', {$scope:$scope}); + $scope.data = {}; if (angular.isDefined(conf.pollDefaultPageSize)) { $scope.pageSize = conf.pollDefaultPageSize; @@ -1123,7 +1127,6 @@ angular.module('pollControllers', []) else { $scope.pageSize = -1; } - $scope.urlPagination = $scope.setUrl(['page', 'pageSize']); var paginationParameter = {pageSize:$scope.pageSize}; if (angular.isDefined($routeParams.page)) { @@ -1136,7 +1139,7 @@ angular.module('pollControllers', []) } var initPolls = function () { - Poll.get({paginationParameter:paginationParameter}, function (data) { + Poll.get({paginationParameter:paginationParameter, cmd:$routeParams.cmd}, function (data) { $scope.data.polls = data.elements $scope.data.pollsPagination = data.pagination; }, function (error) { diff --git a/pollen-ui-angular/src/main/webapp/js/services.js b/pollen-ui-angular/src/main/webapp/js/services.js index e819aa8..68c3edf 100644 --- a/pollen-ui-angular/src/main/webapp/js/services.js +++ b/pollen-ui-angular/src/main/webapp/js/services.js @@ -25,7 +25,7 @@ angular.module('pollenServices', ['ngResource']) ////////////////////////////////////// .factory('Poll', ['$resource', function ($resource) { - return $resource(conf.restURL+'/polls/:pollId', {pollId:'@id'}, { + return $resource(conf.restURL+'/polls/:pollId/:cmd', {pollId:'@id'}, { 'skeletonNew' : { method : 'GET', url : conf.restURL+'/polls/new' -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.