From f60c18d83223e6fcb87c857f3be94e31f1801c18 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 30 Mar 2017 09:36:12 +0200 Subject: [PATCH] [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 --- addons/website_sale/static/src/js/website_sale.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 21dedb78f39..fe00be9e057 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -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'}); + } });