diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-21 15:57:50 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-21 15:57:50 -0500 |
| commit | c223032bbd67fe5b6ad1334ce81a3f51a7631bfc (patch) | |
| tree | 9f832d23e348a3b92030ec7da6053d7eece24254 /StoneIsland/www/js/lib/cart/CartSummary.js | |
| parent | 29380aa560c05186aa67b7b36d4a40c65e570d35 (diff) | |
cart empty warning
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartSummary.js')
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartSummary.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js index d8619990..290627d3 100644 --- a/StoneIsland/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/www/js/lib/cart/CartSummary.js @@ -5,18 +5,42 @@ var CartSummary = ScrollableView.extend({ events: { }, - initialize: function(){ + initialize: function(opt){ + this.parent = opt.parent + this.$loader = this.$(".loader") + this.$cart_body = this.$(".cart_body") + this.$cart_empty = this.$(".cart_empty") this.scroller = new IScroll('#cart_summary', app.iscroll_options) }, show: function(){ document.body.className = "cart" app.cart.el.className = "summary" + this.$loader.show() + + sdk.cart.get_status({ + success: this.populate.bind(this), + error: this.error.bind(this), + }) + }, + + populate: function(data){ + this.$loader.hide() app.footer.show("SHIPPING >", "CANCEL") + + console.log(data) + + this.parent.$itemcount.html("1 ITEM") + + this.$el.removeClass("empty").addClass("full") this.deferScrollToTop() }, - populate: function(){ + error: function(){ + this.$loader.hide() + app.footer.hide() + this.parent.$itemcount.html("0 ITEMS") + this.$el.addClass("empty").removeClass("full") }, ok: function(){ |
