diff options
Diffstat (limited to 'StoneIsland/www/js/lib/products/GalleryView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/GalleryView.js | 26 |
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(){ |
