You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
1.1 KiB

/** @odoo-module */
import { Discuss } from "@mail/core/common/discuss";
import { patch} from "@web/core/utils/patch";
import { jsonrpc } from "@web/core/network/rpc_service";
const { useRef } = owl;
import { onMounted } from "@odoo/owl";
patch(Discuss.prototype, {
setup() {
super.setup(...arguments);
this.core = useRef("core");
onMounted(async () => {
var self = this;
await jsonrpc('/select_color', {}).then(function(result) {
if (result.background_color !== false){
self.core.el.style.setProperty("--background-color",result.background_color
);
}//set discuss background color
if (result.layout_color !== false){
document.documentElement.style.setProperty("--layout-color",result.layout_color);
}// set discuss layout color
if (result.background_image !== false){
self.core.el.style.setProperty("background-image",'url(data:image/png;base64,'+result.background_image+')',"important");
}// set discuss background image
});
});
},
});