only clear selection on success
authorOwen Smith <owen@omsmith.ca>
Wed, 21 Nov 2012 04:12:25 +0000 (23:12 -0500)
committerOwen Smith <owen@omsmith.ca>
Wed, 21 Nov 2012 04:12:25 +0000 (23:12 -0500)
www/assets/js/ui.js

index 2368a4b..0132b56 100644 (file)
@@ -68,7 +68,7 @@ function SelectionsViewModel () {
        };
 
        self.purchase = function (data, e) {
        };
 
        self.purchase = function (data, e) {
-               var selected = self.selections.removeAll();
+               var selected = self.selections();
 
                var input = $(e.target);
                var cardData = input.val();
 
                var input = $(e.target);
                var cardData = input.val();
@@ -76,6 +76,7 @@ function SelectionsViewModel () {
 
                var result = client.process(cardData, selected);
                if (result === 2) {
 
                var result = client.process(cardData, selected);
                if (result === 2) {
+                       self.clearSelection();
                        $('#checkout-modal').modal('hide');
                }
        };
                        $('#checkout-modal').modal('hide');
                }
        };