[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.
This commit is contained in:
qsm-odoo
2016-07-05 18:05:24 +02:00
parent 73898ccb8b
commit 3d8d2ed50e
+3 -1
View File
@@ -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;
},