Daily updates from Odoo
Thursday, December 19, 2019
1 change
Code cleanup and technical improvements
The website editor now handles hidden page elements more consistently by showing or hiding their editing options instead of triggering actions directly on invisible content. This makes editing snippets such as countdowns, popups, and mailing blocks clearer and reduces confusing behavior when content is hidden or saved.
Original PR description
* website, website_mass_mailing
Instead of triggering an event on the invisible element when its related
button in the left panel is clicked, the invisible element's options are
now toggled (shown if were hidden and hidden if were shown). To do that
the new 'onTargetShow' and 'onTargetHide' methods are called, and the
appropriate action can be done there.
Those two new methods are also automatically called in other cases:
- When dropped in the page, after onBuild, 'onTargetShow' is called
for any snippet.
- Before cleanForSave: 'onTargetHide' is called for snippets with the
'o_snippet_invisible' and 'onTargetShow' is called for the others.
In case the element visibility should be toggled another way (like the
close button of a modal), the option can trigger_up an event named
'snippet_option_visibility_update' with a 'show' parameter so that the
the UI is updated accordingly (and so that the options are hidden if
necessary).