-
- Downloads
[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
Showing
- addons/web_editor/static/src/js/editor/snippets.editor.js 86 additions, 25 deletionsaddons/web_editor/static/src/js/editor/snippets.editor.js
- addons/web_editor/static/src/js/editor/snippets.options.js 16 additions, 0 deletionsaddons/web_editor/static/src/js/editor/snippets.options.js
- addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js 21 additions, 11 deletions...mass_mailing/static/src/js/website_mass_mailing.editor.js
Loading
Please register or sign in to comment