From 10efb0f7b426426057fed757fe3c851a249358dd Mon Sep 17 00:00:00 2001 From: Rene Ae Date: Fri, 4 Dec 2015 20:32:44 -0600 Subject: android build --- .../android/assets/www/js/lib/cart/CartView.js | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 StoneIsland/platforms/android/assets/www/js/lib/cart/CartView.js (limited to 'StoneIsland/platforms/android/assets/www/js/lib/cart/CartView.js') diff --git a/StoneIsland/platforms/android/assets/www/js/lib/cart/CartView.js b/StoneIsland/platforms/android/assets/www/js/lib/cart/CartView.js new file mode 100755 index 00000000..1b08e418 --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/js/lib/cart/CartView.js @@ -0,0 +1,66 @@ +var CartView = View.extend({ + + el: "#cart", + + events: { + "click .summary_step": "show_summary", + "click .shipping_step": "show_shipping", + "click .payment_step": "show_payment", + }, + + initialize: function(){ + this.summary = new CartSummary ({ parent: this }) + this.payment = new CartPayment ({ parent: this }) + this.shipping = new CartShipping ({ parent: this }) + this.confirm = new CartConfirm ({ parent: this }) + this.thanks = new CartThanks ({ parent: this }) + this.error = new CartError ({ parent: this }) + + this.$steps = this.$(".steps") + this.$full_msg = this.$(".full_msg") + this.$empty_msg = this.$(".empty_msg") + this.$itemcount = this.$(".itemcount") + }, + + load: function(){ + sdk.cart.get_status({ + success: function(data){ + this.summary.data = data + this.summary.updateCounts() + }.bind(this), + error: function(data){ + console.log(data) + }, + }) + }, + + show: function(){ + document.body.className = "cart" + this.show_summary() + }, + + show_summary: function(){ + this.summary.show() + }, + + show_shipping: function(){ + this.shipping.show() + }, + + show_payment: function(){ + this.payment.show() + }, + + setHeaderCount: function(n){ + if (n) { + this.$itemcount.html(pluralize(n, "ITEM", "S")) + this.$full_msg.show() + this.$empty_msg.hide() + } + else { + this.$full_msg.hide() + this.$empty_msg.show() + } + }, + +}) \ No newline at end of file -- cgit v1.2.3-70-g09d2