var CartSummary = ScrollableView.extend({ el: "#cart_summary", events: { }, 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() }, error: function(){ this.$loader.hide() app.footer.hide() this.parent.$itemcount.html("0 ITEMS") this.$el.addClass("empty").removeClass("full") }, ok: function(){ }, cancel: function(){ }, })