Commit 474fe5544cb0df0567a806c66de99eb2501a3512

Authored by Caio Almeida
1 parent 61267f5d

Ticket #83: Just show "more comments" button if there are 20 comments

www/html/_proposal.html
... ... @@ -73,7 +73,7 @@
73 73 </div>
74 74  
75 75 <p style="text-align: center;">
76   - <button class="button icon-left ion-plus-circled" ng-click="loadComments()">Mais comentários</button>
  76 + <button class="button icon-left ion-plus-circled" ng-click="loadComments()" ng-show="proposal.comments.length >= 20">Mais comentários</button>
77 77 </p>
78 78 </div>
79 79 </ion-content>
... ...
www/js/controllers.js
... ... @@ -538,7 +538,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
538 538 }
539 539 else {
540 540 // Initiate the modal
541   - $ionicModal.fromTemplateUrl('html/_proposal.html?17', {
  541 + $ionicModal.fromTemplateUrl('html/_proposal.html?18', {
542 542 scope: $scope,
543 543 animation: 'slide-in-up'
544 544 }).then(function(modal) {
... ... @@ -942,7 +942,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
942 942 if (!$scope.proposal.comments) $scope.proposal.comments = [];
943 943  
944 944 var last = $scope.proposal.lastCommentId || 0;
945   - path = 'articles/' + $scope.proposal.id + '/comments?oldest&reference_id=' + last + '&private_token=' + $scope.token;
  945 + path = 'articles/' + $scope.proposal.id + '/comments?oldest&reference_id=' + last + '&private_token=' + $scope.token + '&t=' + (new Date().getTime());
946 946  
947 947 $http.get(ConfJuvAppUtils.pathTo(path), config)
948 948 .then(function(resp) {
... ...