Skip to content
Snippets Groups Projects
Commit 8703c01d authored by Younn Olivier's avatar Younn Olivier Committed by qsm-odoo
Browse files

[FIX] web_tour: fix the tooltip content font-size

Before this commit, the tooltip content of a tour had a font-size set in
rem. As its container dimensions were computed using the root element
font-size, these dimensions were not correct if the tip was inserted in
a document with another root element font-size.

This was leading to a bug after [1] added an iframe to edit the website:
the backend and frontend root elements font-size are different and the
containers of tips targeting frontend elements were clipped.

This commit fixes the tooltip content font-size in px (with the
font-size used to compute the container dimensions), so that it can be
placed in iframes with a different root element font-size.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b



task-3035156

closes odoo/odoo#104039

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 4f463092
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,9 @@ var Tip = Widget.extend({
this.el.style.removeProperty('transition');
this.$tooltip_content.html(this.info.content);
this.$window = $(window);
// Fix the content font size as it was used to compute the height and
// width of the container.
this.$tooltip_content[0].style.fontSize = getComputedStyle(this.$tooltip_content[0])['font-size'];
this.$tooltip_content.css({
width: "100%",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment