From 7d9950316368d825510588ded16e5194b4840931 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 23 Nov 2015 01:45:53 -0500 Subject: add to cart after signin.. --- StoneIsland/www/js/lib/nav/HeaderView.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'StoneIsland/www/js/lib/nav/HeaderView.js') diff --git a/StoneIsland/www/js/lib/nav/HeaderView.js b/StoneIsland/www/js/lib/nav/HeaderView.js index 4425917d..7563be2d 100644 --- a/StoneIsland/www/js/lib/nav/HeaderView.js +++ b/StoneIsland/www/js/lib/nav/HeaderView.js @@ -11,6 +11,7 @@ var HeaderView = View.extend({ initialize: function(){ this.$burger = this.$(".burger") this.$cart = this.$(".cart") + this.$cart_count = this.$(".cart_count") }, set_back: function(state){ @@ -38,5 +39,17 @@ var HeaderView = View.extend({ cart: function(){ app.router.go("cart") }, + + count: 0, + set_cart_count: function(n){ + this.count = n + this.$cart_count.html(n) + }, + increment_cart_count: function(){ + this.$cart_count.html( ++this.count ) + }, + decrement_cart_count: function(){ + this.$cart_count.html( --this.count ) + }, }) \ No newline at end of file -- cgit v1.2.3-70-g09d2