[REM] website: remove useless page option callback

The page options code had a callback for header_text_color, this one was
useless because the select style code already does the job. This commit
removes this useless code and allows the page options not to have a
callback.

task-2904507

Part-of: odoo/odoo#99732
This commit is contained in:
Guillaume (gdi)
2023-10-12 08:09:27 +00:00
committed by qsm-odoo
parent 534caa041d
commit 4631e0731f
@@ -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;
}