-
Notifications
You must be signed in to change notification settings - Fork 116
fix presets preview #4670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master-mysterious-egg
Are you sure you want to change the base?
fix presets preview #4670
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
ac0c790
to
d106b59
Compare
ec1852c
to
b63d27b
Compare
let themePresets = undefined; | ||
if (this.props.enabledTabs && this.props.enabledTabs.includes("theme")) { | ||
const iframeDocument = document.querySelector("iframe").contentWindow.document; | ||
const iframeStyle = iframeDocument.defaultView.getComputedStyle( | ||
iframeDocument.documentElement | ||
); | ||
themePresets = getThemePresets(iframeStyle); | ||
} |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document.querySelector("iframe")
isn't robust. What if another iframe matches because the code changes in the future.
Can't the iframe or iframeStyle be passed as a props or through the env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can pass it as a props but I still need to get it from somewhere. How can I robustly get it ? Is there a reference to the iframe stored somewhere ?
031fec2
to
ed6ea41
Compare
ed6ea41
to
b379bb0
Compare
[QSM, firefox] Go the theme tab -> Change the button colors of each color preset -> Add a snippet -> Open the colorpicker to change the background => The preview are not using the new colors