summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js19
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartView.js1
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js9
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/CollectionView.js12
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/ProductView.js7
5 files changed, 27 insertions, 21 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
index 02491b32..c1daf656 100755
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
@@ -35,11 +35,8 @@ var BlogView = View.extend({
break
case "closed":
app.closed.storeIsClosed = true
- app.closed.storeOpenDate = null
- break
- case "openson":
- app.closed.storeIsClosed = true
- app.closed.storeOpenDate = moment(data.store[0].OpensOn)
+ app.closed.storeClosedMessageOne = data.store[0].StoreClosedMessageOne
+ app.closed.storeClosedMessageTwo = data.store[0].StoreClosedMessageTwo
break
}
@@ -48,6 +45,7 @@ var BlogView = View.extend({
}
else {
app.gallery_id = data.store[0].CollectionId
+ app.department_id = data.store[0].DepartmentId
app.collection.setCollectionName( data.store[0].collection )
app.collection.fetch()
}
@@ -70,10 +68,13 @@ var BlogView = View.extend({
console.log(data.store[0].StoreStatus)
- var fits_large = (data.store[0].FitsLarge === "true")
- app.product.$fit.toggle( fits_large )
- app.product.$sizing.toggle( fits_large )
-
+ app.product.fitLargeCodes = {}
+ if (data.store[0].FittingCodes.length) {
+ data.store[0].FittingCodes.split("\n").forEach(function(code){
+ app.product.fitLargeCodes[code] = true
+ })
+ }
+
if (data.store[0].BackgroundIsGray === "true") {
app.collection.$el.addClass("gray")
app.product.gallery.$el.addClass("gray")
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
index 1b08e418..9fd7bc8d 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js
@@ -30,6 +30,7 @@ var CartView = View.extend({
}.bind(this),
error: function(data){
console.log(data)
+
},
})
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js b/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
index 6f7b8486..2f242ba4 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
@@ -22,13 +22,12 @@ var ClosedStoreView = View.extend({
document.body.className = "closed"
this.animate()
app.footer.hide()
- if (this.storeOpenDate) {
- var date = moment(this.storeOpenDate).format("MM/DD")
- console.log(date)
- $(".closed_store_msg h3").html("THIS STORE WILL OPEN ON " + date)
+ $(".closed_store_msg h3").html(app.closed.storeClosedMessageOne || "THIS STORE IS CURRENTLY CLOSED")
+ if (app.closed.storeClosedMessageTwo) {
+ $(".closed_store_msg h4").show().html(app.closed.storeClosedMessageTwo)
}
else {
- $(".closed_store_msg h3").html("THIS STORE IS CURRENTLY CLOSED")
+ $(".closed_store_msg h4").hide()
}
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
index 53e99390..5480c016 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
@@ -25,10 +25,8 @@ var CollectionView = ScrollableView.extend({
},
show: function(){
- if (app.closed.storeIsClosed) {
- if (! app.closed.storeOpenDate || app.closed.storeOpenDate.diff() > 0) {
- return app.closed.show()
- }
+ if (sdk.env !== "test" && app.closed.storeIsClosed) {
+ return app.closed.show()
}
app.footer.show("FILTER")
document.body.className = "collection"
@@ -44,7 +42,7 @@ var CollectionView = ScrollableView.extend({
save: function(){
this.filterView.filter()
},
-
+
fetch: function(){
console.log("collection fetch")
if (this.loaded) {
@@ -52,9 +50,9 @@ var CollectionView = ScrollableView.extend({
return
}
this.$loader.show()
- console.log("fetching", app.gallery_id)
+ console.log("fetching", app.department_id)
sdk.product.collection({
- gallery_id: app.gallery_id,
+ department_id: app.department_id,
success: this.populate.bind(this)
})
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
index 484cd442..5cfb0b50 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
@@ -50,6 +50,7 @@ var ProductView = ScrollableView.extend({
color: null,
code: null,
is_onesize: false,
+ fitLargeCodes: {},
sizes: null,
colors: null,
@@ -152,6 +153,8 @@ var ProductView = ScrollableView.extend({
this.item = data
this.details = details['Item']
this.code = data['DefaultCode10']
+
+ console.log( data['DefaultCode10'] )
this.$num.html(num)
this.$title.html(title)
@@ -159,6 +162,10 @@ var ProductView = ScrollableView.extend({
this.$price.html(price)
this.$body.html(body)
+ var fits_large = !! this.fitLargeCodes[this.code]
+ app.product.$fit.toggle( fits_large )
+ app.product.$sizing.toggle( fits_large )
+
this.showFooter()
this.deferScrollToTop()