[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>
This commit is contained in:
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user