summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorjvm-odoo <jvm@odoo.com>2020-07-02 13:11:36 +0000
committerjvm-odoo <jvm@odoo.com>2020-07-08 11:39:09 +0000
commite4235a8d165acbc135a341ac0d09b7aabfabb690 (patch)
tree3b4569fbc40b3be189fe8e8beeee9c7485d229e3 /addons/web
parent0744c29d89dd70067ccaec8bb54fe1fe21c4c43a (diff)
[FIX] web: fix zoomodoo flyout width
Issue - Install eCommerce - Modify a product image with one which has more than 1024px width/height to enable zoom (I used: https://bit.ly/2VETQZS) - Go on the website preview & hover the image Depending on the screen size, a part of the flyout is hidden because of overflow-x if you want to see it, you should scroll right width right arrow key. Cause The flyout has 100% width and is put right (position absolute, left: 100%) Solution To avoid this error on all screen size, the solution is to compute the max-width of the flyout depending on the available space on the right. OPW-2283648 closes odoo/odoo#54222 X-original-commit: c89b4c25ed92542f6fd0279cf3a9e4ef1bac9fa5 Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/static/src/js/libs/zoomodoo.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/src/js/libs/zoomodoo.js b/addons/web/static/src/js/libs/zoomodoo.js
index 1eaa4cedd48..a372c1686dc 100644
--- a/addons/web/static/src/js/libs/zoomodoo.js
+++ b/addons/web/static/src/js/libs/zoomodoo.js
@@ -166,6 +166,11 @@ ZoomOdoo.prototype.show = function (e, testMouseOver) {
}
this.$flyout.css('transform', 'translate3d(' + left + 'px, ' + top + 'px, 0px)');
+ } else {
+ // Computing flyout max-width depending to the available space on the right to avoid overflow-x issues
+ // e.g. width too high so a right zoomed element is not visible (need to scroll on x axis)
+ var rightAvailableSpace = document.body.clientWidth - this.$flyout[0].getBoundingClientRect().left;
+ this.$flyout.css('max-width', rightAvailableSpace);
}
w1 = this.$target[0].offsetWidth;