summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-24 20:57:41 -0500
committerJules Laplace <jules@okfoc.us>2015-11-24 20:57:41 -0500
commit612561818f907f0f9988247c82ec158ba4494986 (patch)
tree8bbc773dad7a6364cbdb8aed2ef4cab04854f49a /StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js
parentd548a7d02ce6349ca9a820b6824e4374b759812b (diff)
build
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