From 89c0266b93c0f2b54b0248be642066bc919e94f1 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 2 May 2016 11:04:04 +0200 Subject: [FIX] web_editor: backend colorpicker in editor The web_editor.colorpicker defines a series of color buttons which toggle the bg-* and text-* classes. The problem is that themes can define new buttons whose bg-* and text-* classes only exist in the frontend. So these buttons should not be displayed in the backend. Only solution for the current implementation is to add this ugly rule (in this backend file) which hides every button and redisplayed the default ones. This fix is temporary and has to be improved in next versions. --- .../web_editor/static/src/less/web_editor.backend.less | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'addons/web_editor/static/src/less/web_editor.backend.less') diff --git a/addons/web_editor/static/src/less/web_editor.backend.less b/addons/web_editor/static/src/less/web_editor.backend.less index 0ff97e327aa..53789aae8af 100644 --- a/addons/web_editor/static/src/less/web_editor.backend.less +++ b/addons/web_editor/static/src/less/web_editor.backend.less @@ -83,3 +83,21 @@ box-shadow: #DDCC33 0 0 5px 2px inset; } } + +// FIX (to improve in next versions) +// --------------------------------- +// The web_editor.colorpicker defines a series of color buttons which toggle the bg-* and text-* classes. +// The problem is that themes can define new buttons whose bg-* and text-* classes only exist in the frontend. +// So these buttons should not be displayed in the backend. Only solution for the current implementation is +// to add this ugly rule (in this backend file) which hides every button and redisplayed the default ones. +.note-editor { + .colorpicker .o_colorpicker_section > button { + display: none; + + &[data-color="alpha"], &[data-color="beta"], &[data-color="gamma"], &[data-color="delta"], &[data-color="epsilon"], + &[data-color="white"], &[data-color="gray-lighter"], &[data-color="gray-light"], &[data-color="gray"], &[data-color="gray-dark"], &[data-color="gray-darker"], &[data-color="black"], + &[data-color="primary"], &[data-color="success"], &[data-color="info"], &[data-color="warning"], &[data-color="danger"] { + display: block; + } + } +} -- cgit v1.2.3