From b3d98498a562e5ce6dccc333562ed079bcac736d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 30 Nov 2015 22:08:25 -0500 Subject: gallery divs --- StoneIsland/www/css/blogs.css | 4 ++++ StoneIsland/www/index.html | 6 +++++- StoneIsland/www/js/lib/products/CollectionView.js | 1 + StoneIsland/www/js/lib/products/GalleryView.js | 8 ++++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/StoneIsland/www/css/blogs.css b/StoneIsland/www/css/blogs.css index ad8cef2f..19e3f8fd 100644 --- a/StoneIsland/www/css/blogs.css +++ b/StoneIsland/www/css/blogs.css @@ -66,6 +66,10 @@ margin:10px auto 100px; } +.hub_item { + position: relative; +} + .content-header { width:calc(100vw - 40px); box-sizing:border-box; diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 977b77cb..5491d98a 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -138,8 +138,10 @@

HUB

+ +
diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index e0d5bf82..056f2a52 100644 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -65,6 +65,7 @@ var CollectionView = ScrollableView.extend({ this.deferScrollToTop() } this.afterFetchCallback && this.afterFetchCallback() + app.collection.deferRefresh() }, append: function(item){ diff --git a/StoneIsland/www/js/lib/products/GalleryView.js b/StoneIsland/www/js/lib/products/GalleryView.js index ea4637eb..b36c5df2 100644 --- a/StoneIsland/www/js/lib/products/GalleryView.js +++ b/StoneIsland/www/js/lib/products/GalleryView.js @@ -31,7 +31,7 @@ var GalleryView = View.extend({ valid_styles[style] = size } }) - Object.keys(valid_styles).forEach(function(style){ + Object.keys(valid_styles).sort(sort_image_styles).forEach(function(style){ var id = valid_styles[style] + "_" + style var t = this.template.replace(/{{image}}/, sdk.image(code, id)) this.$el.append(t) @@ -62,4 +62,8 @@ var GalleryView = View.extend({ touchend: function(e){ }, -}) \ No newline at end of file +}) + +var YOOX_IMAGE_STYLE_ORDER = "ZZZ d f".split(" ") + +function sort_image_styles (b,a){ return (YOOX_IMAGE_STYLE_ORDER.indexOf(a)) - (YOOX_IMAGE_STYLE_ORDER.indexOf(b)) } \ No newline at end of file -- cgit v1.2.3-70-g09d2