Commit 3c4877990fe7bcbb46029c5159af5259a0371306

Authored by Caio Almeida
1 parent ea463fa2

Ticket #147: Avoid changing more than one card at once

Showing 1 changed file with 10 additions and 4 deletions   Show diff stats
www/js/controllers.js
@@ -529,6 +529,8 @@ angular.module('confjuvapp.controllers', []) @@ -529,6 +529,8 @@ angular.module('confjuvapp.controllers', [])
529 $scope.showBackupProposalsLink = true; 529 $scope.showBackupProposalsLink = true;
530 } 530 }
531 } 531 }
  532 +
  533 + $scope.changingCard = false;
532 }; 534 };
533 535
534 $scope.showBackupProposals = function() { 536 $scope.showBackupProposals = function() {
@@ -537,12 +539,16 @@ angular.module('confjuvapp.controllers', []) @@ -537,12 +539,16 @@ angular.module('confjuvapp.controllers', [])
537 $scope.showBackupProposalsLink = false; 539 $scope.showBackupProposalsLink = false;
538 }; 540 };
539 541
  542 + $scope.changingCard = false;
540 $scope.nextCard = function() { 543 $scope.nextCard = function() {
541 - var index = $scope.cards.length - 1;  
542 - if (index == -1) {  
543 - index = 0; 544 + if (!$scope.changingCard) {
  545 + $scope.changingCard = true;
  546 + var index = $scope.cards.length - 1;
  547 + if (index == -1) {
  548 + index = 0;
  549 + }
  550 + $scope.cardDestroyed(index);
544 } 551 }
545 - $scope.cardDestroyed(index);  
546 }; 552 };
547 553
548 /****************************************************************************** 554 /******************************************************************************