diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-04-02 18:52:14 +0200 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-04-02 18:52:14 +0200 |
| commit | 130870e76a8173b1e2563b93ce8a01bdc3fd7d46 (patch) | |
| tree | ca33326936fea92aa86d4693eedf1a607918774a /StoneIsland/www/js/lib/blogs/BlogView.js | |
| parent | 3a12871d8513c1daed9d0309b10df3b40105dad9 (diff) | |
filter by size
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/BlogView.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/blogs/BlogView.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index fe36e025..2f63a5bc 100755 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/www/js/lib/blogs/BlogView.js @@ -31,25 +31,27 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - switch (data.store[0].DepartmentStoreStatus) { + app.store = data.store[0] + + switch (app.store.DepartmentStoreStatus) { case "open": app.closed.storeIsClosed = false break case "closed": app.closed.storeIsClosed = true - app.closed.storeClosedMessageOne = data.store[0].StoreClosedMessageOne - app.closed.storeClosedMessageTwo = data.store[0].StoreClosedMessageTwo + app.closed.storeClosedMessageOne = app.store.StoreClosedMessageOne + app.closed.storeClosedMessageTwo = app.store.StoreClosedMessageTwo break } if (app.closed.storeIsClosed && sdk.env !== 'test') { - app.closed.populate(data.store[0].ClosedStoreImages) + app.closed.populate(app.store.ClosedStoreImages) } else { - app.departments = data.store[0].Departments - app.department_id = data.store[0].Departments[0].uri - $("#collections h1").toggleClass("single-dept", data.store[0].Departments.length == 1) - app.collection.setCollectionName( data.store[0].Departments[0].text ) + app.departments = app.store.Departments + app.department_id = app.store.Departments[0].uri + $("#collections h1").toggleClass("single-dept", app.store.Departments.length == 1) + app.collection.setCollectionName( app.store.Departments[0].text ) //// demo department for shoes with weird SizeTypeId // app.department_id = "NKDrtSC" if (sdk.env === 'test') { @@ -76,16 +78,16 @@ var BlogView = View.extend({ app[page.tag].populate(page) }) - console.log(data.store[0].StoreStatus) + console.log(app.store.StoreStatus) app.product.fitLargeCodes = {} - if (data.store[0].FittingCodes.length) { - data.store[0].FittingCodes.split("\n").forEach(function(code){ + if (app.store.FittingCodes.length) { + app.store.FittingCodes.split("\n").forEach(function(code){ app.product.fitLargeCodes[code] = true }) } - if (data.store[0].BackgroundIsGray === "true") { + if (app.store.BackgroundIsGray === "true") { app.collection.$el.addClass("gray") app.product.gallery.$el.addClass("gray") } |
