Skip to content
Snippets Groups Projects
Commit 2a0a0e52 authored by qsm-odoo's avatar qsm-odoo
Browse files

[REF] web_editor, *: review invisible element click action

* 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).

Part of https://github.com/odoo/odoo/pull/41789
parent 32e294e7
No related branches found
No related tags found
Loading
Loading
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