Re: [Pollen-devel] [Pollen-commits] r3915 - in trunk/pollen-ui-angular/src/main/webapp: js/controllers partials
On Tue, 6 May 2014 10:56:15 +0200 (CEST) garandel@users.chorem.org wrote:
Author: garandel Date: 2014-05-06 10:56:15 +0200 (Tue, 06 May 2014) New Revision: 3915
Url: http://forge.chorem.org/projects/pollen/repository/revisions/3915
Log: update settings popup, and date popup
Modified: trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js trunk/pollen-ui-angular/src/main/webapp/partials/big-poll.html trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html
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-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-06 08:56:15 UTC (rev 3915) @@ -172,7 +172,30 @@
var PollPopupSettingsCtrl = function ($scope, $filter, $modalInstance, poll) { $scope.poll = poll; + $scope.toDay = new Date();
+ $scope.$watch('poll.beginDate', function() { + if (poll.beginChoiceDate) { + if (poll.beginChoiceDate < poll.beginDate) { + poll.beginChoiceDate = poll.beginDate; + } + } + else { + poll.beginChoiceDate = poll.beginDate; + } + }); + + $scope.$watch('poll.endDate', function() { + if (poll.endChoiceDate) { + if (poll.endChoiceDate > poll.endDate) { + poll.endChoiceDate = poll.endDate; + } + } + else { + poll.endChoiceDate = poll.endDate; + } + }); +
Je ne pense pas qu'il faille faire ça. De manière générale, l'ui n'a pas à positionner des valeurs par défaut, c'est la couche REST à lui fournir ce dont elle a besoin. Si on n'a pas de date de fin de choix, y'a une raison, et donc ça doit rester null tant que l'utilisateur n'en a pas choisi une. Il faudrait peut-être rediscuter de tout ça de vive voix cet après-midi. tony. -- Tony Chemit -------------------- tél: +33 (0) 2 40 50 29 28 http://www.codelutin.com email: chemit@codelutin.com twitter: https://twitter.com/tchemit
participants (1)
-
Tony Chemit