diff --git a/addons/website/static/src/components/wysiwyg_adapter/page_options.js b/addons/website/static/src/components/wysiwyg_adapter/page_options.js index a3eeb706a45..069a7f27201 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/page_options.js +++ b/addons/website/static/src/components/wysiwyg_adapter/page_options.js @@ -3,15 +3,6 @@ export const pageOptionsCallbacks = { header_overlay: function (value) { this.document.getElementById('wrapwrap').classList.toggle('o_header_overlay', value); }, - header_color: function (value) { - const headerEl = this.document.querySelector('#wrapwrap > header'); - if (this.value) { - headerEl.classList.remove(this.value); - } - if (value) { - headerEl.classList.add(value); - } - }, header_visible: function (value) { const headerEl = this.document.querySelector('#wrapwrap > header'); headerEl.classList.toggle('d-none', !value); @@ -37,7 +28,9 @@ export class PageOption { this.isDirty = isDirty; this.document = document; this.name = name; - this.callback = pageOptionsCallbacks[name].bind(this); + if (pageOptionsCallbacks[name]) { + this.callback = pageOptionsCallbacks[name].bind(this); + } } get value() { if (this.el.value.toLowerCase() === 'true') { @@ -48,7 +41,9 @@ export class PageOption { return this.el.value; } set value(value) { - this.callback(value); + if (this.callback) { + this.callback(value); + } this.el.value = value; this.isDirty = true; }