From 3c4877990fe7bcbb46029c5159af5259a0371306 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Mon, 19 Oct 2015 01:34:58 -0300 Subject: [PATCH] Ticket #147: Avoid changing more than one card at once --- www/js/controllers.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/www/js/controllers.js b/www/js/controllers.js index 1ef35f9..e62a6e3 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -529,6 +529,8 @@ angular.module('confjuvapp.controllers', []) $scope.showBackupProposalsLink = true; } } + + $scope.changingCard = false; }; $scope.showBackupProposals = function() { @@ -537,12 +539,16 @@ angular.module('confjuvapp.controllers', []) $scope.showBackupProposalsLink = false; }; + $scope.changingCard = false; $scope.nextCard = function() { - var index = $scope.cards.length - 1; - if (index == -1) { - index = 0; + if (!$scope.changingCard) { + $scope.changingCard = true; + var index = $scope.cards.length - 1; + if (index == -1) { + index = 0; + } + $scope.cardDestroyed(index); } - $scope.cardDestroyed(index); }; /****************************************************************************** -- libgit2 0.21.2