summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js')
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js31
1 files changed, 30 insertions, 1 deletions
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