summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-09-11 12:35:49 +0200
committerChristophe Simonis <chs@odoo.com>2017-09-11 12:35:49 +0200
commitec15765eecfecff3e3b0a4cc8810d73f042e30c2 (patch)
tree06207f693e192599fb03c75a707a3f2c1b74d429 /addons/web_editor/static/src/js
parent2a0d62295efcd3b4f3b6a992de2ebb1e2f74623f (diff)
parent48f88992da66a12eb0653a8a69b7d4e0e9389d9e (diff)
[MERGE] forward port branch saas-14 up to 48f88992da6
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/summernote.js5
-rw-r--r--addons/web_editor/static/src/js/widgets.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index 71647828cc6..d28279d57ed 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -504,7 +504,7 @@ dom.removeBetween = function (sc, so, ec, eo, towrite) {
};
for (var i=0; i<nodes.length; i++) {
- if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after)) {
+ if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after) && !dom.isEditable(nodes[i])) {
nodes[i].parentNode.removeChild(nodes[i]);
}
}
@@ -1121,6 +1121,9 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
// double enter on the end of a blockquote & pre = new line out of the list
$('<p></p>').append(br).insertAfter($(r.sc).closest('blockquote, pre'));
node = br;
+ } else if (dom.isEditable(dom.node(r.sc))) {
+ // if we are directly in an editable, only SHIFT + ENTER should add a newline
+ node = null;
} else if (last === r.sc) {
if (dom.isBR(last)) {
last = last.parentNode;
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index aa1d3123db6..f924d879e01 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -914,7 +914,7 @@ var VideoDialog = Widget.extend({
video_id = this.$("#video_id").val();
}
var $iframe = $(
- '<div class="media_iframe_video" data-src="'+this.$iframe.attr("src")+'">'+
+ '<div class="media_iframe_video" data-oe-expression="'+this.$iframe.attr("src")+'">'+
'<div class="css_editable_mode_display">&nbsp;</div>'+
'<div class="media_iframe_video_size" contentEditable="false">&nbsp;</div>'+
'<iframe src="'+this.$iframe.attr("src")+'" frameborder="0" allowfullscreen="allowfullscreen" contentEditable="false"></iframe>'+