[FIX] website: restore top menu transparent color option behavior

The option was not adapted correctly to the new left panel option
system, especially: not adapted to the use of a dedicated colorpicker
widget.

Part of https://github.com/odoo/odoo/pull/45093
task-2151408

X-original-commit: 39ed330ba635af7c81f03df2fdfe4309c95e05d9
This commit is contained in:
qsm-odoo
2020-03-18 19:52:33 +00:00
parent ba5253c7e0
commit 98c8438f52
@@ -1450,6 +1450,22 @@ options.registry.topMenuTransparency = options.Class.extend({
options.registry.topMenuColor = options.Class.extend({
//--------------------------------------------------------------------------
// Options
//--------------------------------------------------------------------------
/**
* @override
*/
selectStyle(previewMode, widgetValue, params) {
this._super(...arguments);
const className = widgetValue ? (params.colorPrefix + widgetValue) : '';
this.trigger_up('action_demand', {
actionName: 'toggle_page_option',
params: [{name: 'header_color', value: className}],
});
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
@@ -1470,24 +1486,6 @@ options.registry.topMenuColor = options.Class.extend({
});
});
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* @override
*/
_onColorButtonClick: function () {
this._super.apply(this, arguments);
var bgs = this.$target.attr('class').match(/bg-(\w|-)+/g);
var allowedBgs = this.classes.split(' ');
var color = _.intersection(bgs, allowedBgs).join(' ');
this.trigger_up('action_demand', {
actionName: 'toggle_page_option',
params: [{name: 'header_color', value: color}],
});
},
});
/**