summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/products/GalleryView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-05 19:02:38 -0500
committerJules Laplace <jules@okfoc.us>2015-11-05 19:02:38 -0500
commitde7d43f46a2430c7b2d8de70d4907e0afed34779 (patch)
treeb572b0fbfb5c4ed9576a12e46727390035f53f5b /StoneIsland/www/js/lib/products/GalleryView.js
parent7c3f73d2e54b7f70bfcbedaa5fb0de82c30c3b85 (diff)
using flickity gallery
Diffstat (limited to 'StoneIsland/www/js/lib/products/GalleryView.js')
-rw-r--r--StoneIsland/www/js/lib/products/GalleryView.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/StoneIsland/www/js/lib/products/GalleryView.js b/StoneIsland/www/js/lib/products/GalleryView.js
index 44eed9f0..a139c454 100644
--- a/StoneIsland/www/js/lib/products/GalleryView.js
+++ b/StoneIsland/www/js/lib/products/GalleryView.js
@@ -6,15 +6,13 @@ var GalleryView = View.extend({
events: {
"click .left": "prev",
"click .right": "next",
- "touchstart .gallery": "touchstart",
- "touchmove .gallery": "touchmove",
- "touchend .gallery": "touchend",
+// "touchstart .gallery": "touchstart",
+// "touchmove .gallery": "touchmove",
+// "touchend .gallery": "touchend",
},
initialize: function(){
- this.$prev = this.$(".prev")
- this.$next = this.$(".next")
- this.$slider = this.$(".slider")
+ this.$(".template").remove()
},
populate: function(code, image_ids){
@@ -31,9 +29,21 @@ var GalleryView = View.extend({
Object.keys(valid_styles).forEach(function(style){
var id = valid_styles[style] + "_" + style
var t = this.template.replace(/{{image}}/, sdk.image(code, id))
- .replace(/{{id}}/, sdk.image(code, id))
- this.$slider.append(t)
+ this.$el.append(t)
}.bind(this))
+
+ this.gallery = new Flickity( "#gallery", {
+ selector: '.item',
+ cellAlign: 'center',
+ autoPlay: false,
+ freeScroll: false,
+ wrapAround: true,
+ imagesLoaded: true,
+ prevNextButtons: false,
+ pageDots: false,
+ contain: true,
+ draggable: true,
+ })
},
prev: function(){