From 7c00503008d9e5e9e17e62bfefc267ce87aa78d1 Mon Sep 17 00:00:00 2001 From: "Laurent Stukkens (LTU)" Date: Wed, 15 Apr 2020 14:39:02 +0000 Subject: [PATCH] [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 --- addons/web_tour/static/src/js/tip.js | 6 ++++-- addons/web_tour/static/src/scss/tip.scss | 4 ++++ addons/web_tour/static/src/xml/tip.xml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/web_tour/static/src/js/tip.js b/addons/web_tour/static/src/js/tip.js index 5156fada00a..b08c12dce52 100644 --- a/addons/web_tour/static/src/js/tip.js +++ b/addons/web_tour/static/src/js/tip.js @@ -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; diff --git a/addons/web_tour/static/src/scss/tip.scss b/addons/web_tour/static/src/scss/tip.scss index b27a428e437..1e9a9e34a47 100644 --- a/addons/web_tour/static/src/scss/tip.scss +++ b/addons/web_tour/static/src/scss/tip.scss @@ -75,6 +75,10 @@ } } + &.o_tooltip_fixed { + position: fixed; + } + &::before { content: ""; border: 0 solid rgba(0, 0, 0, 0); diff --git a/addons/web_tour/static/src/xml/tip.xml b/addons/web_tour/static/src/xml/tip.xml index 8874b5b72e8..09bad5610eb 100644 --- a/addons/web_tour/static/src/xml/tip.xml +++ b/addons/web_tour/static/src/xml/tip.xml @@ -1,6 +1,6 @@ -
+