[FIX] website_sale: product detail scroll

On mobile view, in the product detail page, the image of the product
fills the largest part of the screen. However, when the user tries to
scroll by clicking on the image, it zooms on the image instead of
actually scrolling. This is confusing for the users who report that they
cannot buy anything on the webshop.

A solution is to simply deactivate the zoom on mobile.

opw-704026
This commit is contained in:
Nicolas Martinelli
2017-03-30 11:15:55 +02:00
parent 7bbbc6f12d
commit f60c18d832
@@ -74,6 +74,7 @@ odoo.define('website_sale.website_sale', function (require) {
var ajax = require('web.ajax');
var utils = require('web.utils');
var core = require('web.core');
var config = require('web.config');
var _t = core._t;
if(!$('.oe_website_sale').length) {
@@ -452,5 +453,8 @@ odoo.define('website_sale.website_sale', function (require) {
$("select[name='country_id']").change();
});
$('.ecom-zoomable img[data-zoom]').zoomOdoo({ attach: '#o-carousel-product'});
// Deactivate image zoom for mobile devices, since it might prevent users to scroll
if (config.device.size_class > config.device.SIZES.XS) {
$('.ecom-zoomable img[data-zoom]').zoomOdoo({ attach: '#o-carousel-product'});
}
});