summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/transcoder.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-22 13:12:33 +0100
committerqsm-odoo <qsm@odoo.com>2017-03-22 13:12:33 +0100
commit1505fee0e3d2460d062281100d306c279c144236 (patch)
tree733656f18b199cc770f6d82e16a03bb88967308e /addons/web_editor/static/src/js/transcoder.js
parent8ec819418b1b302f4f681b42945fe088be72616d (diff)
[FIX] web_editor: properly transcode `fa` alias icons
When adding a font-awesome icon to a mail template, the icon is converted to an image once the template is saved. To do that, the code checks all the `.fa-XXX` definitions in the stylesheets to know which content the image have to use. The problem is that this was not considering the font-awesome aliases. Indeed, the `fa-facebook-f` icon was able to be used while its alias `fa-facebook` was not working.
Diffstat (limited to 'addons/web_editor/static/src/js/transcoder.js')
-rw-r--r--addons/web_editor/static/src/js/transcoder.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js
index 306369cddfa..ca6f751f954 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -132,7 +132,7 @@ var font_to_img = function ($editable) {
var icon, content;
_.find(widget.fontIcons, function (font) {
return _.find(widget.getCssSelectors(font.parser), function (css) {
- if ($font.is(css[0].replace(/::?before$/, ''))) {
+ if ($font.is(css[0].replace(/::?before/g, ''))) {
icon = css[2].split("-").shift();
content = css[1].match(/content:\s*['"]?(.)['"]?/)[1];
return true;