8000 fix presets preview by emge-odoo · Pull Request #4670 · odoo-dev/odoo · GitHub
[go: up one dir, main page]

Skip to content

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

Open
wants to merge 2 commits into
base: master-mysterious-egg
Choose a base branch
from

Conversation

emge-odoo
Copy link

[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

@robodoo
Copy link
robodoo commented May 14, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged.

@emge-odoo emge-odoo force-pushed the master-mysterious-egg-fix-presets-preview-emge branch from ac0c790 to d106b59 Compare May 14, 2025 13:27
@emge-odoo emge-odoo requested a review from ged-odoo May 14, 2025 13:27
@emge-odoo emge-odoo force-pushed the master-mysterious-egg-fix-presets-preview-emge branch 4 times, most recently from ec1852c to b63d27b Compare May 14, 2025 14:25
Comment on lines +114 to +121
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);
}
Copy link

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?

Copy link
Author

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 ?

@emge-odoo emge-odoo force-pushed the master-mysterious-egg-fix-presets-preview-emge branch from 031fec2 to ed6ea41 Compare May 15, 2025 09:49
@emge-odoo emge-odoo force-pushed the master-mysterious-egg-fix-presets-preview-emge branch from ed6ea41 to b379bb0 Compare May 15, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0