diff options
| author | Laurent Stukkens (LTU) <ltu@odoo.com> | 2020-04-15 14:39:02 +0000 |
|---|---|---|
| committer | Laurent Stukkens (LTU) <ltu@odoo.com> | 2020-05-08 07:56:09 +0000 |
| commit | 7c00503008d9e5e9e17e62bfefc267ce87aa78d1 (patch) | |
| tree | b6727224a5c208b1df4a33614529c18ead7dfe04 /addons | |
| parent | ba898ddbb74a1ab63aceeff008ee5d044f4ee890 (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_tour/static/src/js/tip.js | 6 | ||||
| -rw-r--r-- | addons/web_tour/static/src/scss/tip.scss | 4 | ||||
| -rw-r--r-- | 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 @@ <?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"/> |
