summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-03-03 10:48:57 +0100
committerNicolas Martinelli <nim@odoo.com>2016-03-03 13:24:40 +0100
commitfad47882722408a120ecfcd88b3ff650d4e09d2f (patch)
treea72b605861c8263e9cc09cd51aa46323f540fee1 /addons/web_editor/static
parentdb95dcd8bc593f1c232277bf7149c4c5a2baa4a7 (diff)
[FIX] web_editor: image size
Make sure to create an image of a size larger than zero. A size of zero will generate a traceback.
Diffstat (limited to 'addons/web_editor/static')
-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 14461ba1cf6..d327252b63d 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -133,7 +133,7 @@ var font_to_img = function ($editable) {
});
if (content) {
var color = $font.css("color").replace(/\s/g, '');
- var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+$font.height(), window.encodeURI(content), window.encodeURI(color));
+ var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+Math.max(1, $font.height()), window.encodeURI(content), window.encodeURI(color));
var $img = $("<img/>").attr("src", src)
.attr("data-class", $font.attr("class"))
.attr("class", $font.attr("class").replace(new RegExp("(^|\\s+)" + icon + "(-[^\\s]+)?", "gi"), '')) // remove inline font-awsome style