[FIX] web_tour: Correct misplaced tip info mode in iframe

* The info mode was misplaced when running into iframe.

* Added static position to the tip when anchor position is fixed

Task Id 2216067
Closes #48529
This commit is contained in:
Laurent Stukkens (LTU)
2020-05-08 07:56:09 +00:00
parent ba898ddbb7
commit 7c00503008
3 changed files with 9 additions and 3 deletions
+4 -2
View File
@@ -56,6 +56,8 @@ var Tip = Widget.extend({
attach_to: async function ($anchor) {
this._setupAnchor($anchor);
this.is_anchor_fixed_position = this.$anchor.css("position") === "fixed";
// The body never needs to have the o_tooltip_parent class. It is a
// safe place to put the tip in the DOM at initialization and be able
// to compute its dimensions and reposition it if required.
@@ -366,10 +368,10 @@ var Tip = Widget.extend({
return;
}
if (this.$el.parent()[0] !== document.body) {
if (this.$el.parent()[0] !== this.$el[0].ownerDocument.body) {
this.$el.detach();
this.$el.css(offset);
this.$el.appendTo(document.body);
this.$el.appendTo(this.$el[0].ownerDocument.body);
}
var mbLeft = 0;
+4
View File
@@ -75,6 +75,10 @@
}
}
&.o_tooltip_fixed {
position: fixed;
}
&::before {
content: "";
border: 0 solid rgba(0, 0, 0, 0);
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<div t-name="Tip" t-attf-class="o_tooltip #{widget.info.position}">
<div t-name="Tip" t-attf-class="o_tooltip #{widget.info.position} #{widget.is_anchor_fixed_position ? 'o_tooltip_fixed' : ''}">
<div class="o_tooltip_overlay"/>
<div class="o_tooltip_content" t-attf-style="width: #{widget.info.width}px;">
<t t-raw="widget.info.content"/>