From 3d8d2ed50ec3b8dd6d81d9d01000a20018d5090e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 5 Jul 2016 12:48:11 +0200 Subject: [PATCH] [FIX] web_tour: ideal location to append tip The tip was currently placed in the first parent which can scroll. This is wrong if there is a parent which is position:fixed in that element which scrolls (as it would not follow the scrolling as it is fixed). The ideal location is now the first parent which can scroll or which is position:fixed. Note: there are still two cases which may not work but they are considered rare enough to not handle them : * A position:fixed element which is overflow:hidden too * A position:absolute element whose relative ancestor is an ancestor of the ancestor element which can scroll. --- addons/web_tour/static/src/js/tip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_tour/static/src/js/tip.js b/addons/web_tour/static/src/js/tip.js index 23db51babcf..d7cb7e9bb6b 100644 --- a/addons/web_tour/static/src/js/tip.js +++ b/addons/web_tour/static/src/js/tip.js @@ -119,10 +119,12 @@ return Widget.extend({ _get_ideal_location: function () { var $location = this.$anchor; var o; + var p; do { $location = $location.parent(); o = $location.css("overflow"); - } while ((o === "visible" || o === "hidden") && $location[0] !== document.body); + p = $location.css("position"); + } while ((o === "visible" || o === "hidden") && p !== "fixed" && $location[0] !== document.body); return $location; },