[FIX] website: correctly destroy autohideMenu widget
When changing the color of the header with the custom colorpicker and saving the changes, the autohideMenu widget was destroyed before finishing the rendering. The commit fixes the destroy method of this widget, testing if the variables are defined before using them. task-2519545 closes odoo/odoo#72193 X-original-commit: c003c8d0620c6eda8f8b482d7519ca00a3007d03 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -451,7 +451,7 @@ publicWidget.registry.autohideMenu = publicWidget.Widget.extend({
|
||||
*/
|
||||
destroy() {
|
||||
this._super(...arguments);
|
||||
if (!this.noAutohide) {
|
||||
if (!this.noAutohide && this.$topMenu) {
|
||||
$(window).off('.autohideMenu');
|
||||
dom.destroyAutoMoreMenu(this.$topMenu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user