summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-02-02 14:55:52 +0100
committerChristophe Simonis <chs@odoo.com>2016-02-02 14:55:52 +0100
commit04416a5a6f1a3b4cf1a8bed8e9aee9c30c91a03e (patch)
tree1fd974be09d12c53ed02a221de553f6f83efc253 /addons/web_editor/static
parent7e3d6e92b6a7af27d8c2ebb0dbbecba28c9f1877 (diff)
parent469e04e97c2aa60d9d41bd430e0aeba77ee6f9dd (diff)
[MERGE] forward port of branch saas-9 up to 469e04e
Diffstat (limited to 'addons/web_editor/static')
-rw-r--r--addons/web_editor/static/src/css/backend.css2
-rw-r--r--addons/web_editor/static/src/js/backend.js2
-rw-r--r--addons/web_editor/static/src/js/summernote.js15
-rw-r--r--addons/web_editor/static/src/js/transcoder.js6
4 files changed, 16 insertions, 9 deletions
diff --git a/addons/web_editor/static/src/css/backend.css b/addons/web_editor/static/src/css/backend.css
index 33a7155354c..2512b1de9c0 100644
--- a/addons/web_editor/static/src/css/backend.css
+++ b/addons/web_editor/static/src/css/backend.css
@@ -5,7 +5,7 @@
line-height: initial !important;
color: initial !important;
}
-.oe_form_field_html_text iframe.o_readonly {
+.oe_form_field_html_text .o_readonly {
min-height: 1em;
width: 100%;
margin: 0;
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index becd0fe4769..7649d923f98 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -73,7 +73,7 @@ var FieldTextHtmlSimple = widget.extend({
self.resize();
});
} else {
- this.$content = $('<div class="note-editable o_readonly"/>');
+ this.$content = $('<div class="o_readonly"/>');
this.$textarea.hide().after(this.$content);
}
} else {
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index e31faaab601..e4d1c5b27c4 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -1065,11 +1065,6 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
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);
- var last = node;
- while (node && dom.isSplitable(node) && !dom.isList(node)) {
- last = node;
- node = node.parentNode;
- }
// table: add a tr
var td = dom.ancestor(node, dom.isCell);
@@ -1083,7 +1078,15 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
dom.scrollIntoViewIfNeeded(br);
event.preventDefault();
return false;
- } else if (last === node && !dom.isBR(node)) {
+ }
+
+ var last = node;
+ while (node && dom.isSplitable(node) && !dom.isList(node)) {
+ last = node;
+ node = node.parentNode;
+ }
+
+ if (last === node && !dom.isBR(node)) {
node = r.insertNode(br, true);
if (isFormatNode(last.firstChild) && $(last).closest(options.styleTags.join(',')).length) {
dom.moveContent(last.firstChild, last);
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js
index c26ba163d11..361c072a48c 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -173,7 +173,11 @@ var class_to_style = function ($editable) {
style = k+":"+v+";"+style;
}
});
- $target.attr("style", style);
+ if (_.isEmpty(style)) {
+ $target.removeAttr("style");
+ } else {
+ $target.attr("style", style);
+ }
});
};
// convert style into inline class from mail