summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/products/ProductView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/products/ProductView.js')
-rw-r--r--StoneIsland/www/js/lib/products/ProductView.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js
index a179d227..c5a7ff29 100644
--- a/StoneIsland/www/js/lib/products/ProductView.js
+++ b/StoneIsland/www/js/lib/products/ProductView.js
@@ -44,8 +44,10 @@ var ProductView = ScrollableView.extend({
cache: {},
load: function(code, data){
+ this.gallery.reset()
this.show()
if (! app.collection.loaded) {
+ this.el.className = "loading"
app.collection.afterFetchCallback = this.load.bind(this, code, data)
app.collection.fetch()
return
@@ -58,6 +60,9 @@ var ProductView = ScrollableView.extend({
if (code in this.cache) {
return this.populate(data, this.cache[code])
}
+ else {
+ this.el.className = "loading"
+ }
sdk.product.item({
code: code,
success: function(details){
@@ -68,7 +73,7 @@ var ProductView = ScrollableView.extend({
},
populate: function(data, details){
- this.show()
+ this.el.className = ""
console.log(data, details)
var descriptions = {}
@@ -86,7 +91,7 @@ var ProductView = ScrollableView.extend({
var size_label = SIZE_LOOKUP[size]
var color = data['Colors'].length && data['Colors'][0]
var color_label = color && color['Text']
- var body = descriptions['EditorialDescription']
+ var body = descriptions['EditorialDescription'].replace(/<br>/g, "<br><br>")
this.item = data
this.color = color