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/products/CollectionView.js | |
| parent | 3a12871d8513c1daed9d0309b10df3b40105dad9 (diff) | |
filter by size
Diffstat (limited to 'StoneIsland/www/js/lib/products/CollectionView.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/products/CollectionView.js | 26 |
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() } }, |
