From 612561818f907f0f9988247c82ec158ba4494986 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 24 Nov 2015 20:57:41 -0500 Subject: build --- .../platforms/ios/www/js/lib/nav/HeaderView.js | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js') diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js index bbf18274..7563be2d 100644 --- a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js +++ b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js @@ -9,10 +9,27 @@ var HeaderView = View.extend({ }, initialize: function(){ + this.$burger = this.$(".burger") + this.$cart = this.$(".cart") + this.$cart_count = this.$(".cart_count") + }, + + set_back: function(state){ + if (state) { + this.$burger[0].className = "burger ion-ios-arrow-left" + } + else { + this.$burger[0].className = "burger ion-android-menu" + } }, nav: function(){ - app.nav.show() + if (app.view.back) { + app.view.back() + } + else { + app.nav.show() + } }, logo: function(){ @@ -22,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