summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/products/GalleryView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/products/GalleryView.js')
-rwxr-xr-xStoneIsland/www/js/lib/products/GalleryView.js45
1 files changed, 32 insertions, 13 deletions
diff --git a/StoneIsland/www/js/lib/products/GalleryView.js b/StoneIsland/www/js/lib/products/GalleryView.js
index 809ba0d9..417b14c3 100755
--- a/StoneIsland/www/js/lib/products/GalleryView.js
+++ b/StoneIsland/www/js/lib/products/GalleryView.js
@@ -59,20 +59,13 @@ var GalleryView = View.extend({
draggable: true,
})
if (app.accessible) {
- gallery.select(1, false, true)
+ gallery.select(1, true, true)
}
- this.gallery.on('change', function(){
- var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"")
- var partz = currentImage.split("_")
- var head = partz[0]
- var size = partz[1]
- var tail = partz[2]
- var end_partz = tail.split(/\./)
- var style = end_partz[0]
- var label = YOOX_IMAGE_STYLE_LABELS[style] || "Image: Alternate view"
- $("#product .gallery-target").attr('aria-label', label)
- })
+ var last_style = 'f'
+ this.gallery.on('select', function(){
+ this.updateLabel()
+ }.bind(this))
this.gallery.on('staticClick', this.static_click.bind(this))
@@ -94,10 +87,36 @@ var GalleryView = View.extend({
var largest_size = this.large_styles[style]
var title = YOOX_IMAGE_STYLE_LABELS[style] || "Alternate view"
var hiresImage = [head, largest_size, tail].join("_")
- console.log(partz, style)
+ // console.log(partz, style)
app.fullscreenViewer.show(currentImage, hiresImage, title)
},
+ animating: false,
+ previous: function(e){
+ this.gallery.previous()
+ this.updateLabel()
+ },
+ next: function(e){
+ this.gallery.next()
+ this.updateLabel()
+ },
+ updateLabel: function(){
+ var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"")
+ var partz = currentImage.split("_")
+ var head = partz[0]
+ var size = partz[1]
+ var tail = partz[2]
+ var end_partz = tail.split(/\./)
+ var style = end_partz[0]
+ if (style === this.last_style) {
+ style = 'z'
+ }
+ this.last_style = style
+ var label = YOOX_IMAGE_STYLE_LABELS[style] || "Image: Alternate view"
+ console.log("> new style: " + style)
+ $("#product .gallery-target").attr('aria-label', label)
+ },
+
touchstart: function(e){
},
touchmove: function(e){