From c2ae012505bd532ecf0fd401ddbbd29be69ccf15 Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Thu, 6 Oct 2022 09:22:28 +0000 Subject: [PATCH] [FIX] website: reload connectors on step column duplication/deletion This commit allows to regenerate the connectors of the step block when one of the columns of the block is duplicated or deleted. Steps to reproduce the fixed bug: - Drop a steps block - Duplicate one of the columns => The last column of the first row has a connector to the right of the page. closes odoo/odoo#102797 X-original-commit: 56522f4a26c95878bb726f54eb02c8c948576875 Signed-off-by: Quentin Smetz (qsm) --- .../static/src/snippets/s_process_steps/options.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/website/static/src/snippets/s_process_steps/options.js b/addons/website/static/src/snippets/s_process_steps/options.js index c62160a351c..a3c34bd690c 100644 --- a/addons/website/static/src/snippets/s_process_steps/options.js +++ b/addons/website/static/src/snippets/s_process_steps/options.js @@ -4,6 +4,20 @@ import options from 'web_editor.snippets.options'; import weUtils from 'web_editor.utils'; options.registry.StepsConnector = options.Class.extend({ + /** + * @override + */ + start() { + this.$target.on('content_changed.StepsConnector', () => this._reloadConnectors()); + return this._super(...arguments); + }, + /** + * @override + */ + destroy() { + this._super(...arguments); + this.$target.off('.StepsConnector'); + }, //-------------------------------------------------------------------------- // Options