summaryrefslogtreecommitdiff
path: root/addons/website_event/static/src
diff options
context:
space:
mode:
authorAuthor Name <rve@odoo.com>2020-03-23 16:14:37 +0000
committerDramixDw <rve@odoo.com>2020-06-04 11:35:09 +0000
commit11907c17bb3055242e5889d7b7ec6f055d14ea46 (patch)
tree677f51497274031972fa91f2d5281eeac2cf5820 /addons/website_event/static/src
parent8edac8ab977d0f124076755654d754223206df74 (diff)
[FIX] website_event: event registration in edit mode
The event registration form is made up of a public widget that instantiates an internal normal widget. All public widget are automatically destroyed when entering in edit mode as well as the widget it created. Therefore, it's main element is removed from the DOM when the widget is destroyed. Here, we're detaching the main element from the internal widget before the widget is destroyed so that we avoid to destroy his main element from the DOM when entering in edit mode. task-2210733 closes odoo/odoo#52426 X-original-commit: d515e4233a009250f41e8a1c1b02235685a69532 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website_event/static/src')
-rw-r--r--addons/website_event/static/src/js/website_event.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js
index 36c0f5df526..527d954c524 100644
--- a/addons/website_event/static/src/js/website_event.js
+++ b/addons/website_event/static/src/js/website_event.js
@@ -77,8 +77,16 @@ publicWidget.registry.EventRegistrationFormInstance = publicWidget.Widget.extend
*/
start: function () {
var def = this._super.apply(this, arguments);
- var instance = new EventRegistrationForm(this);
- return Promise.all([def, instance.attachTo(this.$el)]);
+ this.instance = new EventRegistrationForm(this);
+ return Promise.all([def, this.instance.attachTo(this.$el)]);
+ },
+ /**
+ * @override
+ */
+ destroy: function () {
+ this.instance.setElement(null);
+ this._super.apply(this, arguments);
+ this.instance.setElement(this.$el);
},
});