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.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js
index 803acc76..7b634138 100755
--- a/StoneIsland/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/www/js/lib/products/CollectionView.js
@@ -5,6 +5,7 @@ var CollectionView = ScrollableView.extend({
template: $("#collection .template").html(),
loaded: false,
data: null,
+ filtered_items: null,
items: {},
events: {
@@ -35,10 +36,11 @@ var CollectionView = ScrollableView.extend({
if (sdk.env !== "test" && app.closed.storeIsClosed) {
return app.closed.show()
}
+
if (this.data && this.data.SearchResponseFull.Results.Items.length < 4) {
app.footer.hide()
}
- else if (app.store.FilterBy !== "none") {
+ if (app.store.FilterBy !== "none") {
if (app.store.FilterBy === "category") {
app.footer.show("FILTER")
}
@@ -126,16 +128,20 @@ var CollectionView = ScrollableView.extend({
// }
console.log( data.SearchResponseFull.Results.Items.length )
+
+ var items = this.filtered_items || data.SearchResponseFull.Results.Items
if (app.store.GroupBy === 'size') {
- this.groupBySize( data.SearchResponseFull.Results.Items, is_single_product )
+ this.groupBySize( items, is_single_product )
}
else {
- this.appendItems( data.SearchResponseFull.Results.Items, is_single_product )
+ this.appendItems( items, is_single_product )
}
- this.deferScrollToTop()
+ // this.restoreScroll()
+ // this.deferScrollToTop()
}
this.afterFetchCallback && this.afterFetchCallback()
- app.collection.deferRefresh()
+ this.deferRefresh()
+ this.restoreScroll()
},
groupBySize: function(items, is_single_product){
@@ -180,6 +186,7 @@ var CollectionView = ScrollableView.extend({
var $t = $(t)
if (app.store.ShowProductNameOnCollectionPage) {
var $title = $("<span>")
+ $title.addClass("product-title")
$title.html( item['ModelNames'] )
$t.append($title)
}
@@ -189,6 +196,7 @@ var CollectionView = ScrollableView.extend({
pick: function(e){
var code = $(e.currentTarget).data("code")
var data = this.items[code]
+ this.saveScroll()
app.product.load(code, data)
},