summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend/convert_inline.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2020-01-24 16:59:18 +0000
committerNicolas Lempereur <nle@odoo.com>2020-01-27 16:03:38 +0000
commit661e190a3f63630621386a4f4f774b28eacdaae0 (patch)
tree317bf9153ad1c118516f6345e61e4c6821204634 /addons/web_editor/static/src/js/backend/convert_inline.js
parent0c075552f70381872d177f900ed00fbfab39be0e (diff)
[FIX] mass_mailing, web_editor: edit font awesome icon with zoom
In case of font-awesome icon when the browser is being zoomed, we can get a decimal font-size. There is a system that transform font-awesome in image links so they are readable in any email client (supporting image) but it did not take into account decimal font-size. With this changeset, we only send a integer font size: we do not try to get the original value because styling is relative on elements, a 90% zoom ratio could lead to a 98% font-awesome icon ratio. Also improve edition of font-awesome icon edition after first save by reverting the transformation to image on edit. Thanks to that, the original size will also be reinstated and will not depend on zoom on previous save. opw-2156069 closes #43949 closes odoo/odoo#44033 X-original-commit: fe72bf01b67ea20ddb74a5b05464c63cc77090ef Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/backend/convert_inline.js')
-rw-r--r--addons/web_editor/static/src/js/backend/convert_inline.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js
index 4482a8f67ba..8f8daab67c7 100644
--- a/addons/web_editor/static/src/js/backend/convert_inline.js
+++ b/addons/web_editor/static/src/js/backend/convert_inline.js
@@ -205,7 +205,7 @@ function fontToImg($editable) {
if (content) {
var color = $font.css('color').replace(/\s/g, '');
$font.replaceWith($('<img/>', {
- src: _.str.sprintf('/web_editor/font_to_img/%s/%s/%s', content.charCodeAt(0), window.encodeURI(color), Math.max(1, $font.height())),
+ src: _.str.sprintf('/web_editor/font_to_img/%s/%s/%s', content.charCodeAt(0), window.encodeURI(color), Math.max(1, Math.round($font.height()))),
'data-class': $font.attr('class'),
'data-style': $font.attr('style'),
class: $font.attr('class').replace(new RegExp('(^|\\s+)' + icon + '(-[^\\s]+)?', 'gi'), ''), // remove inline font-awsome style