diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-05 01:02:20 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-05 01:02:20 -0500 |
| commit | 4a04a1129fffd1e128e53ba7886777c8d7b36b55 (patch) | |
| tree | 79d394f2e14909e234ce8ffb9e1dfe5244678d23 /StoneIsland/www/js/lib/products/ProductView.js | |
| parent | 83517eb8d489cfceda8e6b7ab1b104a8f0b1f3a8 (diff) | |
populate product view
Diffstat (limited to 'StoneIsland/www/js/lib/products/ProductView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index c0a1ee79..0e4063df 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -8,7 +8,7 @@ var SIZE_LOOKUP = { "XXXL": "XXX-LARGE", }; -var ProductView = View.extend({ +var ProductView = ScrollableView.extend({ el: "#product", @@ -44,7 +44,16 @@ var ProductView = View.extend({ cache: {}, load: function(code, data){ - window.location.href = "#/product/" + code + this.show() + if (! app.collection.loaded) { + app.collection.afterFetchCallback = this.load.bind(this, code, data) + app.collection.fetch() + return + } + else { + app.collection.afterFetchCallback = null + } + window.location.href = "#/store/" + code data = data || app.collection.items[code] if (code in this.cache) { return this.populate(data, this.cache[code]) @@ -59,6 +68,8 @@ var ProductView = View.extend({ }, populate: function(data, details){ + this.show() +console.log(data, details) var name_partz = data['ModelNames'].split(' ') var num = name_partz.shift() var title = name_partz.join(' ') |
