summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/backend.js12
-rw-r--r--addons/web_editor/static/src/js/summernote.js2
-rw-r--r--addons/web_editor/static/src/js/transcoder.js2
3 files changed, 10 insertions, 6 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 72bf61cbb7f..2a33cdd4758 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -38,6 +38,7 @@ var FieldTextHtmlSimple = widget.extend({
['insert', ['link', 'picture']],
['history', ['undo', 'redo']]
],
+ 'prettifyHtml': false,
'styleWithSpan': false,
'inlinemedia': ['p'],
'lang': "odoo",
@@ -66,12 +67,15 @@ var FieldTextHtmlSimple = widget.extend({
if (this.get("effective_readonly")) {
if (this.options['style-inline']) {
- this.$textarea.hide().after('<iframe class="o_readonly"/>');
- setTimeout(function () {
- self.$content = $("body", self.$('iframe').contents()[0]);
+ var $iframe = $('<iframe class="o_readonly"/>');
+ this.$textarea.hide().after($iframe);
+ var load = function () {
+ self.$content = $($iframe.contents()[0]).find("body");
self.$content.html(self.text_to_html(self.get('value')));
self.resize();
- });
+ };
+ setTimeout(load);
+ $iframe.on('load', load);
} else {
this.$content = $('<div class="o_readonly"/>');
this.$textarea.hide().after(this.$content);
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index e4d1c5b27c4..00cd04ac16b 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -1062,8 +1062,8 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
}
}
+ var node = dom.node(r.sc);
var exist = r.sc.childNodes[r.so] || r.sc;
- var node = dom.node(exist);
exist = dom.isVisibleText(exist) || dom.isBR(exist) ? exist : dom.hasContentAfter(exist) || (dom.hasContentBefore(exist) || exist);
// table: add a tr
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