summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-11 19:47:36 -0500
committerJules Laplace <jules@okfoc.us>2015-11-11 19:47:36 -0500
commit79897a642e0dbe3d1d4e11d58e3614da682eae7a (patch)
tree3f6e34f4ec499ae6136a2bd526468fa3dabdef38 /StoneIsland/www/js
parent9dbef9843e2a63c04ed26f7c11d184d8925f2eb5 (diff)
chisel sizes/colors into product view
Diffstat (limited to 'StoneIsland/www/js')
-rw-r--r--StoneIsland/www/js/lib/_router.js3
-rw-r--r--StoneIsland/www/js/lib/products/ProductView.js11
2 files changed, 9 insertions, 5 deletions
diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js
index 47f0ec26..c4019571 100644
--- a/StoneIsland/www/js/lib/_router.js
+++ b/StoneIsland/www/js/lib/_router.js
@@ -36,7 +36,7 @@ var SiteRouter = Router.extend({
var fn
for (var route in this.routes) {
fn = this.routes[route]
- if (! this.hasOwnProperty(fn)) {
+ if (! fn in this) {
this[fn] = this.default_view(fn)
}
}
@@ -67,6 +67,7 @@ var SiteRouter = Router.extend({
},
product: function(code){
+ console.log("FUCK YES")
app.view = app.product
app.product.load(code)
app.product.show()
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js
index 9b7912aa..19a1f795 100644
--- a/StoneIsland/www/js/lib/products/ProductView.js
+++ b/StoneIsland/www/js/lib/products/ProductView.js
@@ -20,11 +20,10 @@ var ProductView = ScrollableView.extend({
this.$size = this.$(".size")
this.$color = this.$(".color")
this.$body = this.$(".body")
-
- app.footer.show("ADD TO CART", "&lt; BACK TO SHOPPING")
},
show: function(){
+ app.footer.show("ADD TO CART", "&lt; BACK TO SHOPPING")
document.body.className = "product"
},
hide: function(){
@@ -71,6 +70,7 @@ var ProductView = ScrollableView.extend({
populate: function(data, details){
this.el.className = ""
+
console.log(data, details)
var descriptions = {}
@@ -90,8 +90,11 @@ var ProductView = ScrollableView.extend({
var color = this.colors[default_color_id]
var color_label = color.label
- var size = data['Sizes'][0]
- var size_label = SIZE_LOOKUP[size]
+ var sizes = this.find_sizes_for_color(default_color_id)
+ var size = sizes[0]
+ var size_label = this.sizes[size].label
+
+ // console.log(color, color_label, size, size_label)
this.item = data
this.details = details['Item']