diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-13 20:15:35 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-13 20:15:35 -0500 |
| commit | 93e3a8798987bcc714b6da832ecea849ad904324 (patch) | |
| tree | 2895b856f9b9b4d691c2766648659f81b27e58d0 /StoneIsland/www/js/lib/products/CollectionView.js | |
| parent | 9ce684a526225cd70b88410355764abd2f66b01c (diff) | |
split filters out and stub color/size pickers
Diffstat (limited to 'StoneIsland/www/js/lib/products/CollectionView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/CollectionView.js | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 652aa92b..571bb4fc 100644 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -20,6 +20,7 @@ var CollectionView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#collection', app.iscroll_options) + this.filterView = new CategoryFilter ({ parent: this }) }, show: function(){ @@ -32,36 +33,9 @@ var CollectionView = ScrollableView.extend({ }, ok: function(){ - var cats = this.data.SearchResponseFull.Refinements.Filters.Categories.map(function(cat){ - return { - id: cat.Id, - label: cat.Value - } - }) - if (this.filter_choice) { - cats.push({ - id: "__remove_filter", - label: "REMOVE FILTER", - }) - } - app.selector.select(cats, this.filter.bind(this)) + this.filterView.filter() }, - filter_choice: null, - filter: function(choice){ - this.$content.empty() - if (choice.id == "__remove_filter") { - this.filter_choice = null - this.data.SearchResponseFull.Results.Items.forEach(this.append.bind(this)) - } - else { - this.filter_choice = choice - this.data.SearchResponseFull.Results.Items.filter(function(item){ - return item.MacroCategory == choice.label - }).forEach(this.append.bind(this)) - } - this.deferScrollToTop() - }, - + fetch: function(){ if (this.loaded) return this.$loader.show() |
