summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/nav/HeaderView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/nav/HeaderView.js')
-rw-r--r--StoneIsland/www/js/lib/nav/HeaderView.js13
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