summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorDipalee Bhalodia <dbh@odoo.com>2018-08-13 10:29:07 +0530
committerqsm-odoo <qsm@odoo.com>2018-08-21 12:09:45 +0200
commit43e29e5d8fd059f42b3543f3f6ee5e88f68f0c52 (patch)
treeb387a6c2686a0715e2f2b7d1adec8b6ed80f7b59 /addons/web_editor/static/src/js/editor
parent0218c4d506ffe00d46b67e3f1ad44f85a9a22352 (diff)
[FIX] web_editor: restore custom colors feature
- The current code found colors in the page which were not custom colors (because we were case-sensitive for hex values) - Applying custom colors font font/background were inverted
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js
index a1ea02d948c..0e28eb0d237 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -45,7 +45,7 @@ function _rgbToHex(rgb) {
if (!hex) {
return rgb; // TODO handle error
}
- return hex.hex;
+ return hex.hex.toUpperCase();
};
// Update and change the popovers content, and add history button
@@ -471,8 +471,8 @@ $.summernote.pluginEvents.customColor = function (event, editor, layoutInfo, cus
onSave: function (color) {
var $palettes = $(event.currentTarget).find('.note-custom-color-palette > .note-color-row')
.append(('<button type="button" class="note-color-btn" data-value="' + color + '" style="background-color:' + color + ';" />'));
- $palettes.filter(':even').find('button:not([data-event])').attr('data-event', 'backColor');
- $palettes.filter(':odd').find('button:not([data-event])').attr('data-event', 'foreColor');
+ $palettes.filter(':odd').find('button:not([data-event])').attr('data-event', 'backColor');
+ $palettes.filter(':even').find('button:not([data-event])').attr('data-event', 'foreColor');
if (customColor === 'foreColor') {
$(event.currentTarget).find('.note-fore-color-preview > button').css('border-bottom-color', color);
$.summernote.pluginEvents.foreColor(event, editor, layoutInfo, color);