01/02: setup spinner in voterList form
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 586df05664df9644ab7514246746560fe69f3789 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Jun 20 18:08:45 2014 +0200 setup spinner in voterList form --- pollen-ui-angular/src/main/webapp/js/app.js | 19 +++++++------------ .../main/webapp/partials/poll-listParticipant.html | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/app.js b/pollen-ui-angular/src/main/webapp/js/app.js index a186282..8dd1a9c 100644 --- a/pollen-ui-angular/src/main/webapp/js/app.js +++ b/pollen-ui-angular/src/main/webapp/js/app.js @@ -240,15 +240,11 @@ angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userC var save = function () { if (scope.change) { - // other change - scope.timeout = $timeout(function () { - scope.change = false; - scope.oldVal[attrs.ngModel] = scope.$eval(attrs.ngModel);; - scope.$apply(function () { - scope.$eval(attrs.autoSave); - }); - $timeout.cancel(scope.timeout); - }, 200); + scope.change = false; + scope.oldVal[attrs.ngModel] = scope.$eval(attrs.ngModel);; + scope.$apply(function () { + scope.$eval(attrs.autoSave); + }); } }; @@ -256,15 +252,14 @@ angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userC if (scope.timeout) { $timeout.cancel(scope.timeout) } - save(); + scope.timeout = $timeout(save,1000); }); element.bind('blur', function () { if (scope.timeout) { $timeout.cancel(scope.timeout) } - // timeout for conflit with event change - $timeout(save, 50); + scope.timeout = $timeout(save, 100); }); } } diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html b/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html index 5273ec0..dc0ef80 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html @@ -64,7 +64,7 @@ <tr ng-show="data.poll.pollType == 'GROUP'" ng-class="{'has-success':voterList.group.id && !voterList.group.restError}"> <th colspan="2" ng-class="{'has-error':voterList.group.restError.name}"> <input type="text" name="group" placeholder="name group" ng-model="voterList.group.name" class="form-control" auto-save="saveVoterList(voterList)" focus-me="!voterList.group.id"/></th> - <th class="weight" ng-class="{'has-error':voterList.group.restError.weight}"> <input type="number" ng-model="voterList.group.weight" select-on-click class="form-control" auto-save="saveVoterList(voterList)" /> </th> + <th class="weight" ng-class="{'has-error':voterList.group.restError.weight}"> <input type="number" step="0.1" min="0" ng-model="voterList.group.weight" select-on-click class="form-control" auto-save="saveVoterList(voterList)" /> </th> <th class="action"> </th> </tr> @@ -78,7 +78,7 @@ <tr ng-repeat="member in voterList.members" ng-class="{'has-success':member.id && !member.restError}"> <td> <input-error error="member.restError.name[0]"><input type="text" ng-model="member.name" class="form-control" auto-save="saveVoterListMember(member, voterList)"/></input-error></td> <td> <input-error error="member.restError.email[0]"><input type="text" ng-model="member.email" class="form-control" auto-save="saveVoterListMember(member, voterList)" /></input-error></td> - <td class="weight"> <input-error error="member.restError.weight[0]"><input type="number" ng-model="member.weight" select-on-click class="form-control" auto-save="saveVoterListMember(member, voterList)"/></input-error></td> + <td class="weight"> <input-error error="member.restError.weight[0]"><input type="number" step="0.1" min="0" ng-model="member.weight" select-on-click class="form-control" auto-save="saveVoterListMember(member, voterList)"/></input-error></td> <td class="action"> <button class="btn btn-danger" ng-click="deleteVoterListMember(member, voterList);" tooltip="{{ 'action.restricted.deleteVoter' | translate }}"><span class="glyphicon glyphicon-trash"></span></button></td> </tr> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm