summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/cart/CartView.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartView.js100
1 files changed, 50 insertions, 50 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
index 6ed8238f..e1ee355d 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
@@ -1,72 +1,72 @@
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")
+
+ 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(){
+
+ load: function () {
+ app.curtain.show("loading");
sdk.cart.get_status({
- success: function(data){
- this.summary.data = data
- this.summary.updateCounts()
+ success: function (data) {
+ this.summary.data = data;
+ this.summary.updateCounts();
+ app.curtain.hide("loading");
}.bind(this),
- error: function(data){
- console.log(data)
- auth.clear_cart()
+ error: function (data) {
+ console.log(data);
+ auth.clear_cart();
+ app.curtain.hide("loading");
},
- })
+ });
},
- show: function(){
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO<br>VIEW YOUR CART.", "")
- return
+ show: function () {
+ if (!navigator.onLine) {
+ app.closed.showElement();
+ app.closed.setMessage("PLEASE GO ONLINE TO<br>VIEW YOUR CART.", "");
+ return;
}
- document.body.className = "cart"
- this.show_summary()
+ document.body.className = "cart";
+ this.show_summary();
},
-
- show_summary: function(){
- this.summary.show()
+
+ show_summary: function () {
+ this.summary.show();
},
-
- show_shipping: function(){
- this.shipping.show()
+
+ show_shipping: function () {
+ this.shipping.show();
},
-
- show_payment: function(){
- this.payment.show()
+
+ show_payment: function () {
+ this.payment.show();
},
- setHeaderCount: function(n){
+ 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()
+ 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
+});