-
Notifications
You must be signed in to change notification settings - Fork 118
[FIX] html_editor: update font size selector on set tag in toolbar #4777
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
[FIX] html_editor: update font size selector on set tag in toolbar #4777
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg-next, it needs to be retargeted before it can be merged. |
@robodoo r+ |
Branch |
@robodoo r- |
Branch |
Didn't realize it wasn't for master |
It looks good, I'll wait for the tests to go green. One small issue:
|
9c49b9e
to
7d3fffc
Compare
import { | ||
removeClass, | ||
removeStyle, | ||
unwrapContents, | ||
wrapInlinesInBlocks, | ||
splitTextNode, | ||
} from "../utils/dom"; |
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.
This is just linting.
37253b5
to
a668b51
Compare
@robinlej Thanks for reviewing. I fixed the issue you raised and in doing so I changed approaches entirely (because it couldn't be solved with the other approach). I added a note in the commit message on future work that might be needed because I lack proper context to know exactly what is or isn't expected in terms of re-rendering of Owl components in the context of Since it touches on some editor specific stuff, I thought it would be best for one of our own to review it too. @sébastien (sge) and I discussed it IRL, I made some more changes, and he approved the approach. |
a668b51
to
2ab5b63
Compare
@robinlej Do you know who wrote odoo/addons/html_builder/static/src/core/builder_options_plugin.js Lines 115 to 121 in 2e9b9d5
If we were to remove Removing odoo/addons/html_builder/static/src/core/builder_options_plugin.js Lines 118 to 120 in 2e9b9d5
So was there a reason for it or can these lines be removed? cc @sebgeelen |
Many hands have been involved around From the look of it, it seems mainly there to avoid frequent computations while we can just rely on the last known containers. We could test to see if there's a performance cost to removing it. |
2ab5b63
to
3c9840c
Compare
2e9b9d5
to
8c5e439
Compare
Because when we change the link element in the popover and apply, we always close the current one and open a new one, the loading at the apply is redundant. We do the reopening to let the overlay plugin reposition popover, and let browser handle the relative/root-relative url to add the domain.
8c5e439
to
2e0c6b5
Compare
5d804da
to
6264308
Compare
@robinlej So I applied that fix, and I added a test for safety (passes with the fix, doesn't otherwise). I tested manually, with many (nested) snippets and didn't notice any obvious performance cost. Edit: one test failed ("useDomState callback shouldn't be called when the editingElement is removed") and revealed a special case so instead of removing the lines I put them in an |
This commit contains multiple changes squashed together, coming from various pull requests on master-mysterious-egg. These changes includes: - No image in colorpicker and working gradient editor for preset background - Clean carousel related tests, remove repeated ones and merge/rename files - Fix logo adding/removing option - Use only "color" tabs in countdown color picker options - Add support for compact hex colors (e.g. #fff) - Fix color styling - Fix setExtraStep - Auto-optimize image upon replace media - Adapt extra product image to also rely on openMediaDialog - Use correct mimetype fields from dataset - Adapt tests - Refresh Dynamic Snippet Carousel when scrolling mode is changed Co-authored-by: Alessandro Lupo <[email protected]> Co-authored-by: Benoit Socias <[email protected]> Co-authored-by: divy-odoo <[email protected]> Co-authored-by: emge-odoo <[email protected]> Co-authored-by: FrancoisGe <[email protected]> Co-authored-by: Jinjiu Liu <[email protected]> Co-authored-by: Keval Bhatt <[email protected]> Co-authored-by: Serhii Rubanskyi - seru <[email protected]>
2e0c6b5
to
8478118
Compare
6264308
to
b6689f5
Compare
In website builder: 1. Select text 2. Change heading type in the toolbar -> the font size selector in the toolbar is blank. This is because the font size input is in an iframe, and a chain of events triggered by changing the heading type (`setTag`) leads to the iframe's document to be re-rendered. This only happens in the website builder because of a call to `updateContainers` as a step_added handler that triggers the `change_current_options_containers_listeners`. These listeners are triggered because `setTag` replaced the block which was the target of the `BuilderOptionsPlugin` with another. The target is not connected anymore so it was assumed we would always need to reset the containers, but the target didn't really change, it was simply replaced to change its tag. So this allows going through the checks to see if updating the containers is needed before triggering the listeners. Since in this case it isn't, they won't be and the iframe will remain intact.
b6689f5
to
983a9d1
Compare
7b6e21e
to
921bf70
Compare
Closed in favor of odoo#211807 |
In website builder:
-> the font size selector in the toolbar is blank:
This is because the font size input is in an iframe, and a chain of events triggered by changing the heading type (
setTag
) leads to the iframe's document to be re-rendered. This only happens in the website builder because of a call toupdateContainers
as a step_added handler that triggers thechange_current_options_containers_listeners
.These listeners are triggered because
setTag
replaced the block which was the target of theBuilderOptionsPlugin
with another. The target is not connected anymore so it was assumed we would always need to reset the containers, but the target didn't really change, it was simply replaced to change its tag. So this allows going through the checks to see if updating the containers is needed before triggering the listeners. Since in this case it isn't, they won't be and the iframe will remain intact.