summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/products/CollectionView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/products/CollectionView.js')
-rwxr-xr-xStoneIsland/www/js/lib/products/CollectionView.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js
index 67a3a456..ab4393e6 100755
--- a/StoneIsland/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/www/js/lib/products/CollectionView.js
@@ -22,7 +22,8 @@ var CollectionView = ScrollableView.extend({
this.$content = this.$(".content")
this.$loader = this.$(".loader")
this.scroller = new IScroll('#collection', app.iscroll_options)
- this.filterView = new DepartmentFilter ({ parent: this })
+ this.departmentFilterView = new DepartmentFilter ({ parent: this })
+ this.sizeFilterView = new SizeFilter ({ parent: this })
},
show: function(){
@@ -37,8 +38,13 @@ var CollectionView = ScrollableView.extend({
if (this.data && this.data.SearchResponseFull.Results.Items.length < 4) {
app.footer.hide()
}
- else {
- app.footer.show("FILTER")
+ else if (app.store.FilterBy !== "none") {
+ if (app.store.FilterBy === "category") {
+ app.footer.show("FILTER")
+ }
+ else {
+ app.footer.show("FILTER BY " + app.store.FilterBy.toUpperCase())
+ }
}
document.body.className = "collection"
if (this.loaded) {
@@ -50,8 +56,16 @@ var CollectionView = ScrollableView.extend({
}
},
+ // called when footer is tapped - filter by (x)
save: function(){
- this.filterView.filter()
+ switch (app.store.FilterBy) {
+ case 'none':
+ this.departmentFilterView.filter()
+ break
+ case 'size':
+ this.sizeFilterView.filter()
+ break
+ }
},
fetch: function(){
@@ -98,7 +112,6 @@ var CollectionView = ScrollableView.extend({
if (is_single_product) {
console.log("IS SINGLE PRODUCT")
var item = data.SearchResponseFull.Results.Items[0]
- console.log(item)
var url = sdk.image(item['DefaultCode10'], '13_f')
console.log(url)
var img = new Image ()
@@ -142,9 +155,10 @@ var CollectionView = ScrollableView.extend({
this.$title.html(this.collectionName)
},
+ // filter by department
showDepartmentSelector: function(){
if (this.$("h1").hasClass("single-dept")) {
- this.filterView.filter()
+ this.departmentFilterView.filter()
}
},