diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-23 01:45:53 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-23 01:45:53 -0500 |
| commit | 7d9950316368d825510588ded16e5194b4840931 (patch) | |
| tree | 294fa8647e451eae0d741cfeb88d2173b20fd940 /StoneIsland/www/js/lib/nav/HeaderView.js | |
| parent | 6b37f28e2dba8f191ff5df194e5215399b696faa (diff) | |
add to cart after signin..
Diffstat (limited to 'StoneIsland/www/js/lib/nav/HeaderView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/nav/HeaderView.js | 13 |
1 files changed, 13 insertions, 0 deletions
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 |
