summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-02-10 10:13:24 +0000
committerSamuel Degueldre <sad@odoo.com>2020-02-13 18:02:48 +0000
commit416500f6e3e17ecda5ee1ece1a1d274e5870eaab (patch)
tree595dfbb5c32af82d988f1a865ebec1b98170e566 /addons/web/static/src/js/views/basic/basic_controller.js
parent05e13f456cdc2b849ee1739b22dd1bef77c0f406 (diff)
[IMP] web_editor, website: add callback to editor clone and remove
We recently transitioned to async option methods, this allows us to have better control on the order of execution in the edition workflow, and among other things, keep the editor's UI in sync with the current state of the DOM. However, some snippet options (such as the number of columns option) need to remove or clone portions of the DOM, and as such, trigger the onClone or onRemove methods of the snippets contained in that portion if applicable. Because these methods are defined on other options, we first need to make sure all the snippetEditors for this portion are created, which is asynchronous. This commit adds support for an onSuccess callback to the 'clone_snippet' and 'remove_snippet' event handlers, such that options can choose to be notified when the work has been done, allowing them to wait for it before proceeding. This commit also adapts the layout_column snippet option to make use of that new feature, and remove code that was used as a workaround before, ie: precomputing the expected number of columns after the clone/remove, and using that number to adjust the width of the columns and update the UI. We can now just wait for the clone/remove, and use the real number of columns currently in the DOM. closes odoo/odoo#45343 X-original-commit: c159d58ce9cfca4a44f159b18eb10d1138977e23 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions