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 53434c9b6a91a691548f07db1bc0a4617498c5b9 Author: Adrien <a.garandel@dralagen.fr> Date: Mon Jul 21 10:59:17 2014 +0200 don't save choice if don't have modification --- .../src/main/webapp/js/controllers/pollCtrl.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 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 5c887ef..2df3ff7 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -451,10 +451,21 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.globalVariables.lastDate = angular.copy(choice.choiceValueDate); } else if (choice.choiceType == 'RESOURCE') { - choice.choiceValue = choice.choiceValueImage; + if (angular.isUndefined(choiceEdit.choiceValue) + || + angular.isDefined(choice.choiceValueImage) + && + choice.choiceValueImage.id != choiceEdit.choiceValue.id) { + choice.choiceValue = choice.choiceValueImage; + } } - if (!angular.equals(choiceEdit, choice)) { + if (! angular.equals(choiceEdit.choiceValue, choice.choiceValue) + || + choiceEdit.choiceType != choice.choiceType + || + choiceEdit.description != choice.description) { + choiceEdit.choiceValue = choice.choiceValue; choiceEdit.choiceType = choice.choiceType; choiceEdit.description = choice.description; @@ -466,11 +477,12 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr var PollPopChoiceCtrl = function ($scope, $modalInstance, title, choice, dateFormat) { + var oldChoice = angular.copy(choice); + $scope.title = title; $scope.choice = choice; $scope.dateFormat = dateFormat; - var oldChoice = angular.copy(choice); $scope.saveChoice = function () { $modalInstance.dismiss(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.